public void execute(final Node node) {
   assert node.isReference();
   ApplicationContainer ac = node.getAppContainer();
   ac.collapseAll();
   ac.expand(node);
   ac.expand(node.wrappedObject());
 }
示例#2
0
  public void execute(final Node parentNode) {
    final ApplicationContainer appContainer = parentNode.getAppContainer();
    appContainer
        .getNodeUpdateApi()
        .createObject(
            parentNode.toObjLocation(),
            m_createClass,
            new ObjCreateCallback() {
              @Override
              public void objCreated(final ObjectMeta objMeta) {

                EditableContext editableContext =
                    new SingleTargetEditableContext(
                        objMeta,
                        SingleTargetEditableContext.Mode.CREATE,
                        appContainer.getNodeUpdateApi());
                final Editor defaultEditor =
                    EditorManager.getInstance()
                        .getEditor(
                            editableContext,
                            new EditorAdaptor() {
                              public void save(List<PropertyUpdate> updates, boolean closeOnSave) {
                                appContainer
                                    .getNodeUpdateApi()
                                    .initObject(parentNode, objMeta, updates);
                              }

                              @Override
                              public void close() {
                                appContainer.getNodeUpdateApi().deleteObject(objMeta);
                              }
                            });
                defaultEditor.getMainFrame().setLocationRelativeTo(appContainer.getMainPanel());
                defaultEditor.getMainFrame().setVisible(true);
              }
            });
  }