コード例 #1
0
ファイル: RADComponentNode.java プロジェクト: PrimoS/Netbeans
 /**
  * Remove the node from its parent and deletes it. The default implementation obtains write access
  * to the {@link Children#MUTEX children's lock}, and removes the node from its parent(if any).
  * Also fires a property change.
  *
  * <p>This may be overridden by subclasses to do any additional cleanup.
  *
  * @exception java.io.IOException if something fails
  */
 @Override
 public void destroy() throws java.io.IOException {
   if (component.getNodeReference() == this) {
     if (MetaComponentCreator.isTransparentLayoutComponent(component.getParentComponent())) {
       component = component.getParentComponent();
     }
     if (EventQueue.isDispatchThread()) {
       component.getFormModel().removeComponent(component, true);
     } else {
       EventQueue.invokeLater(
           new Runnable() {
             @Override
             public void run() {
               component.getFormModel().removeComponent(component, true);
             }
           });
     }
   } // otherwise the component was likely already removed with a parent component
   super.destroy();
 }
コード例 #2
0
ファイル: RADComponentNode.java プロジェクト: PrimoS/Netbeans
 private void addLayoutActions(List<Action> actions) {
   if (component.getParentComponent() instanceof RADVisualContainer) {
     actions.add(SystemAction.get(AlignAction.class));
     actions.add(SystemAction.get(SetAnchoringAction.class));
     actions.add(SystemAction.get(SetResizabilityAction.class));
     actions.add(SystemAction.get(ChooseSameSizeAction.class));
     actions.add(SystemAction.get(DefaultSizeAction.class));
     actions.add(SystemAction.get(EncloseAction.class));
     actions.add(SystemAction.get(CustomizeEmptySpaceAction.class));
     actions.add(null);
   }
 }
コード例 #3
0
ファイル: RADComponentNode.java プロジェクト: PrimoS/Netbeans
  private void addContainerActions(List<Action> actions) {
    if (component instanceof RADVisualContainer) {
      if (!((RADVisualContainer) component).hasDedicatedLayoutSupport()) {
        actions.add(SystemAction.get(SelectLayoutAction.class));
        actions.add(SystemAction.get(CustomizeLayoutAction.class));
      }
      if (MenuEditLayer.isMenuBarContainer(component)) {
        actions.add(SystemAction.get(InsertMenuAction.class));
      } else if (MenuEditLayer.isMenuRelatedContainer(component)) {
        actions.add(SystemAction.get(AddSubItemAction.class));
      } else { // only use the AddAction for non-menu containers
        actions.add(SystemAction.get(AddAction.class));
      }
    }
    if (getNewTypes().length != 0) {
      actions.add(null);
      actions.add(SystemAction.get(NewAction.class));
    }
    if (EditContainerAction.isEditableComponent(component)) {
      actions.add(SystemAction.get(EditContainerAction.class));
    }
    if (DesignParentAction.isParentEditableComponent(component)) {
      actions.add(SystemAction.get(DesignParentAction.class));
    }
    if (component.getParentComponent() == null) {
      if (component instanceof RADVisualComponent) {
        actions.add(SystemAction.get(DefaultSizeAction.class));
      }
      if (component instanceof RADVisualContainer
          && !((RADVisualContainer) component).hasDedicatedLayoutSupport()) {
        actions.add(SystemAction.get(CustomizeEmptySpaceAction.class));
      }
    }

    addSeparator(actions);
  }