org.openide.actions.PropertiesAction Java Examples

The following examples show how to use org.openide.actions.PropertiesAction. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JaxWsClientNode.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Override
public Action[] getActions(boolean context) {
    ArrayList<Action> actions = new ArrayList<Action>(Arrays.asList(
        SystemAction.get(OpenAction.class),
        SystemAction.get(JaxWsRefreshAction.class),
        null,
        SystemAction.get(WSEditAttributesAction.class),
        null,
        SystemAction.get(ConfigureHandlerAction.class),
        null,
        SystemAction.get(DeleteAction.class),
        null,
        SystemAction.get(PropertiesAction.class)));
    addFromLayers(actions, "WebServices/Clients/Actions");
    return actions.toArray(new Action[actions.size()]);
}
 
Example #2
Source File: JaxWsNode.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Override
    public Action[] getActions(boolean context) {
        ArrayList<Action> actions = new ArrayList<Action>(Arrays.asList(
                SystemAction.get(OpenAction.class),
//                SystemAction.get(JaxWsRefreshAction.class),
//                null,
                SystemAction.get(AddOperationAction.class),
                null,
                SystemAction.get(WsTesterPageAction.class),
//                null,
                SystemAction.get(WSEditAttributesAction.class),
                SystemAction.get(ConfigureHandlerAction.class),
//                null,
//                SystemAction.get(JaxWsGenWSDLAction.class),
//                null,
//                SystemAction.get(ConvertToRestAction.class),
                null,
                SystemAction.get(DeleteAction.class),
                null,
                SystemAction.get(PropertiesAction.class)));
        addFromLayers(actions, "WebServices/Services/Actions");
        return actions.toArray(new Action[actions.size()]);
    }
 
Example #3
Source File: HudsonJobNode.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Override
public Action[] getActions(boolean context) {
    if (job.getColor() == Color.secured) {
        return new Action[] {new LogInAction(job.getInstance())};
    }
    List<Action> actions = new ArrayList<Action>();
    actions.add(SystemAction.get(StartJobAction.class));
    actions.add(new ProjectAssociationAction(job));
    actions.add(null);
    if (job instanceof OpenableInBrowser) {
        actions.add(OpenUrlAction.forOpenable((OpenableInBrowser) job));
    }
    actions.add(new ViewConfigAction(job));
    actions.add(SystemAction.get(PropertiesAction.class));
    return actions.toArray(new Action[actions.size()]);
}
 
Example #4
Source File: RemoteAWTScreenshot.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Override
public Action[] getActions(boolean context) {
    //FieldInfo fieldInfo = getField();
    ObjectReference component = getComponent();
    ComponentBreakpoint b = ComponentBreakpointActionProvider.findBreakpoint(component);
    
    List<Action> actions = new ArrayList<Action>();
    actions.add(GoToFieldDeclarationAction.get(GoToFieldDeclarationAction.class));
    actions.add(GoToSourceAction.get(GoToSourceAction.class));
    if (getAddCallStack() != null) {
        actions.add(GoToAddIntoHierarchyAction.get(GoToAddIntoHierarchyAction.class));
    }
    actions.add(null);
    actions.add(ShowListenersAction.get(ShowListenersAction.class));
    actions.add(CreateFixedWatchAction.get(CreateFixedWatchAction.class));
    actions.add(null);
    actions.add(ToggleComponentBreakpointAction.get(ToggleComponentBreakpointAction.class));
    if (b != null) {
        actions.add(CBP_CUSTOMIZE_ACTION);
    }
    actions.add(null);
    actions.add(PropertiesAction.get(PropertiesAction.class));
    return actions.toArray(new Action[] {});
}
 
Example #5
Source File: PropertiesLocaleNode.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/** Lazily initialize set of node's actions.
 * Overrides superclass method.
 *
 * @return array of actions for this node
 */
@Override
protected SystemAction[] createActions () {
    return new SystemAction[] {
        SystemAction.get(EditAction.class),
        SystemAction.get(OpenAction.class),
        null,
        SystemAction.get(CutAction.class),
        SystemAction.get(CopyAction.class),
        SystemAction.get(PasteAction.class),
        null,
        SystemAction.get(DeleteAction.class),
        SystemAction.get(LangRenameAction.class),
        null,
        SystemAction.get(NewAction.class),
        SystemAction.get(SaveAsTemplateAction.class),
        null,
        SystemAction.get(FileSystemAction.class),
        null,
        SystemAction.get(ToolsAction.class),
        SystemAction.get(PropertiesAction.class)
    };
}
 
Example #6
Source File: CatalogNode.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public Action[] getActions(boolean context) {
    if (catalog instanceof CatalogWriter)
        return new Action[] {
            SystemAction.get(AddCatalogEntryAction.class),
            SystemAction.get(RefreshAction.class),
            SystemAction.get(CatalogNode.UnmountAction.class),
            null,
            //??? #24349 CustimizeAction sometimes added by BeanNode here
            SystemAction.get(PropertiesAction.class)
        };
    else
        return new Action[] {
            SystemAction.get(RefreshAction.class),
            SystemAction.get(CatalogNode.UnmountAction.class),
            null,
            //??? #24349 CustimizeAction sometimes added by BeanNode here
            SystemAction.get(PropertiesAction.class)
        };
}
 
Example #7
Source File: AnnotationProviderTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/** Gets default system actions. Overrides superclass method. */
protected SystemAction[] defaultActions() {
    return new SystemAction[] {
        SystemAction.get(OpenAction.class),
        SystemAction.get (FileSystemAction.class),
        null,
        SystemAction.get(CutAction.class),
        SystemAction.get(CopyAction.class),
        SystemAction.get(PasteAction.class),
        null,
        SystemAction.get(DeleteAction.class),
        SystemAction.get(RenameAction.class),
        null,
        SystemAction.get(SaveAsTemplateAction.class),
        null,
        SystemAction.get(ToolsAction.class),
        SystemAction.get(PropertiesAction.class),
    };
}
 
Example #8
Source File: DataLoaderGetActionsTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/** Test to see whether a compatibility behaviour is still kept. E.g.
 * if one adds actions using DataLoader.setActions they really will be 
 * there.
 */
public void testCompatibilityIsPropagatedToDisk () throws Exception {
    assertEquals("No actions at the start", Collections.emptyList(), Arrays.asList(node.getActions(false)));
    FileObject test = root;
    
    PCL pcl = new PCL ();
    obj.getLoader ().addPropertyChangeListener (pcl);
    
    obj.getLoader().setActions(new SystemAction[] {
        SystemAction.get(PropertiesAction.class)
    });
    
    pcl.assertEvent (1, "actions");
    
    Action [] res = node.getActions(false);
    assertEquals("There should be exactly one action.", 1, res.length);
    assertEquals("One file created", 1, test.getChildren ().length);
    
    obj.getLoader().setActions(new SystemAction[0]);

    pcl.assertEvent (2, "actions");
    assertEquals("No actions after deleting", 0, node.getActions(false).length);
    
    assertEquals("file disappeared", 0, test.getChildren ().length);
    obj.getLoader ().removePropertyChangeListener (pcl);
}
 
Example #9
Source File: JaxWsNode.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Override
public Action[] getActions(boolean context) {
    //DataObject dobj = getCookie(DataObject.class);
    ArrayList<Action> actions = new ArrayList<Action>(Arrays.asList(
            SystemAction.get(OpenAction.class),
            SystemAction.get(JaxWsRefreshAction.class),
            null,
            SystemAction.get(AddOperationAction.class),
            null,
            SystemAction.get(WsTesterPageAction.class),
            null,
            SystemAction.get(WSEditAttributesAction.class),
            null,
            SystemAction.get(ConfigureHandlerAction.class),
            null,
            SystemAction.get(JaxWsGenWSDLAction.class),
            null,
            SystemAction.get(ConvertToRestAction.class),
            null,
            SystemAction.get(DeleteAction.class),
            null,
            SystemAction.get(PropertiesAction.class)));
    addFromLayers(actions, "WebServices/Services/Actions");
    return actions.toArray(new Action[actions.size()]);
}
 
Example #10
Source File: LookupNode.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public final Action[] getActions(boolean context) {
    if (isUISettingCategoryNode()) {
        return new Action[0];
    } else {
        return new Action[] {
            SystemAction.get(FileSystemAction.class),
            null,
            SystemAction.get(PasteAction.class),
            null,
            SystemAction.get(MoveUpAction.class),
            SystemAction.get(MoveDownAction.class),
            SystemAction.get(ReorderAction.class),
            null,
            SystemAction.get(NewTemplateAction.class),
            null,
            SystemAction.get(ToolsAction.class),
            SystemAction.get(PropertiesAction.class),
        };
    }
}
 
Example #11
Source File: DOMNode.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Override
public Action[] getActions(boolean context) {
    List<Action> actions = new ArrayList<Action>();
    actions.add(SystemAction.get(GoToNodeSourceAction.class));
    if (KnockoutTCController.isKnockoutUsed()) {
        actions.add(SystemAction.get(ShowKnockoutContextAction.class));
    }
    if (node.getNodeType() == org.w3c.dom.Node.ELEMENT_NODE) {
        for (Action action : org.openide.util.Utilities.actionsForPath(ACTIONS_PATH)) {
            if (action instanceof ContextAwareAction) {
                Lookup lookup = new ProxyLookup(Lookups.fixed(this), getLookup());
                action = ((ContextAwareAction)action).createContextAwareInstance(lookup);
            }
            actions.add(action);
        }
        actions.add(null);
        actions.add(SystemAction.get(PropertiesAction.class));
    }
    return actions.toArray(new Action[actions.size()]);
}
 
Example #12
Source File: JaxWsChildren.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
protected Node[] createNodes(Object key) {
    if(key instanceof WebOperationInfo) {
        final WebOperationInfo method = (WebOperationInfo)key;
        Node n = new AbstractNode(Children.LEAF) {

            @java.lang.Override
            public java.awt.Image getIcon(int type) {
                if (cachedIcon == null) {
                    cachedIcon = ImageUtilities.loadImage(OPERATION_ICON);
                }
                return cachedIcon;
            }
            
            @Override
            public Action[] getActions(boolean context) {
                return new Action[]{SystemAction.get(PropertiesAction.class)};
            }

            @Override
            public Action getPreferredAction() {
                return SystemAction.get(PropertiesAction.class);
            }
            
            @Override
            public String getDisplayName() {
                return method.getOperationName()+": "+getClassName(method.getReturnType()); //NOI18N
            } 
        };
        StringBuffer buf = new StringBuffer();
        for (String paramType:method.getParamTypes()) {
            buf.append(buf.length() == 0 ? paramType : ", "+paramType);
        }
        n.setShortDescription(
                NbBundle.getMessage(JaxWsChildren.class,"TXT_operationDesc",method.getReturnType(),method.getOperationName(),buf.toString()));
        return new Node[]{n};
    }
    return new Node[0];
}
 
Example #13
Source File: CatalogEntryNode.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public Action[] getActions(boolean context) {
    if (isCatalogWriter)
        return new Action[] {
            SystemAction.get(EditAction.class),
            SystemAction.get(DeleteAction.class),
            null,
            SystemAction.get(PropertiesAction.class)
        };
    else
        return new Action[] {
            SystemAction.get(ViewAction.class),
            null,
            SystemAction.get(PropertiesAction.class)
        };
}
 
Example #14
Source File: ApkDataObject.java    From NBANDROID-V2 with Apache License 2.0 5 votes vote down vote up
@Override
public Action[] getActions(boolean context) {
    return new Action[]{
        SystemAction.get(SaveAsAction.class),
        SystemAction.get(InstallApkAction.class),
        SystemAction.get(CopyAction.class),
        SystemAction.get(DeleteAction.class),
        SystemAction.get(PropertiesAction.class)
    };
}
 
Example #15
Source File: JaxWsClientNode.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
    public Action[] getActions(boolean context) {
        ArrayList<Action> actions = new ArrayList<Action>(Arrays.asList(
            SystemAction.get(OpenAction.class),
            SystemAction.get(JaxWsRefreshAction.class),
//            null,
            SystemAction.get(WSEditAttributesAction.class),
            SystemAction.get(ConfigureHandlerAction.class),
            null,
            SystemAction.get(DeleteAction.class),
            null,
            SystemAction.get(PropertiesAction.class)));
        addFromLayers(actions, "WebServices/Clients/Actions");
        return actions.toArray(new Action[actions.size()]);
    }
 
Example #16
Source File: JaxWsRootNode.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public Action[] getActions(boolean context) {
    return new Action[]{
        CommonProjectActions.newFileAction(),
        null,
        SystemAction.get(FindAction.class),
        null,
        SystemAction.get(PasteAction.class),
        null,
        SystemAction.get(PropertiesAction.class)
    };
}
 
Example #17
Source File: JaxWsClientRootNode.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public Action[] getActions(boolean context) {
    return new Action[]{
        CommonProjectActions.newFileAction(),
        null,
        SystemAction.get(FindAction.class),
        null,
        SystemAction.get(PasteAction.class),
        null,
        SystemAction.get(PropertiesAction.class)
    };
}
 
Example #18
Source File: WildflyDatasourceNode.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public Action[] getActions(boolean context) {
    return new SystemAction[]{
        SystemAction.get(PropertiesAction.class),
        SystemAction.get(UndeployModuleAction.class)
    };
}
 
Example #19
Source File: DevicesNode.java    From NBANDROID-V2 with Apache License 2.0 5 votes vote down vote up
@Override
public Action[] getActions(boolean context) {
    // TODO add action to restart debug bridge
    return new Action[]{
        new RestartADBAction(),
        SystemAction.get(PropertiesAction.class)
    };
}
 
Example #20
Source File: AdbNode.java    From NBANDROID-V2 with Apache License 2.0 5 votes vote down vote up
@Override
public Action[] getActions(boolean context) {
    // TODO add action to restart debug bridge
    return new Action[]{
        new RestartADBAction(),
        SystemAction.get(PropertiesAction.class)
    };
}
 
Example #21
Source File: WildflyDestinationNode.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public Action[] getActions(boolean context) {
    return new SystemAction[]{
        SystemAction.get(PropertiesAction.class),
        SystemAction.get(UndeployModuleAction.class)
    };
}
 
Example #22
Source File: AbstractMMFilter.java    From netbeans-mmd-plugin with Apache License 2.0 5 votes vote down vote up
@Override
@Nonnull
@MayContainNull
public Action[] getActions(final boolean context) {
  if (!context) {
    if (actions == null) {
      // Copy actions and leave out the PropertiesAction and FileSystemAction.                
      Action superActions[] = super.getActions(context);
      List<Action> actionList = new ArrayList<Action>(superActions.length);

      for (int i = 0; i < superActions.length; i++) {
        if ((i <= superActions.length - 2) && superActions[i] == null && (superActions[i + 1] instanceof PropertiesAction)) {
          i++;
          continue;
        }
        else if (superActions[i] instanceof PropertiesAction) {
          continue;
        }
        else if (superActions[i] instanceof FileSystemAction) {
          actionList.add(null); // insert separator and new action
          actionList.addAll((List<Action>) org.openide.util.Utilities.actionsForPath("Projects/package/Actions"));
        }

        actionList.add(superActions[i]);
      }

      actions = new Action[actionList.size()];
      actionList.toArray(actions);
    }
    return actions;
  }
  else {
    return super.getActions(context);
  }
}
 
Example #23
Source File: EntityChildFactory.java    From jeddict with Apache License 2.0 5 votes vote down vote up
@Override
    protected Node createNodeForKey(EntityWidget entityWidget) {
        AbstractNode node = new AttributeRootNode(Children.create(new AttributeChildFactory(entityWidget), true)) {

            @Override
            public Action[] getActions(boolean context) {
                Action[] result = new Action[]{
                    SystemAction.get(DeleteAction.class),
                    SystemAction.get(PropertiesAction.class)
                };
                return result;
            }

            @Override
            public boolean canDestroy() {
                EntityWidget customer = this.getLookup().lookup(EntityWidget.class);
                return customer != null;
            }

            @Override
            public void destroy() throws IOException {
//                if (deleteEntity(this.getLookup().lookup(Entity.class).getEntityId())) {
//                    super.destroy();
//                    EntityTopComponent.refreshNode();
//                }
            }

        };
        node.setDisplayName(entityWidget.getNodeName());
        node.setShortDescription(entityWidget.getNodeName());
        node.setIconBaseWithExtension(entityWidget.getIconPath());
        return node;
    }
 
Example #24
Source File: VioGenQueryNode.java    From BART with MIT License 5 votes vote down vote up
@Override
public Action[] getActions(boolean context) {
    Action[] result = new Action[]{
        Actions.forID("DependencyNode", 
                "it.unibas.bartgui.controlegt.actions.node.DependenciesNode.Open"),
        null,
        Actions.forID("DependenciesNode", "it.unibas.bartgui.controlegt.actions.node.DependenciesNode.Edit"),
        null,
        SystemAction.get(PropertiesAction.class),
        };
    return result;
}
 
Example #25
Source File: ConfVioGenQueryCNode.java    From BART with MIT License 5 votes vote down vote up
@Override
public Action[] getActions(boolean context) {
        Action[] result = new Action[]{
        Actions.forID("ConfVioGenQueryCNode", "it.unibas.bartgui.controlegt.actions.node.ConfVioGenQ.Edit"),
        null,
        SystemAction.get(PropertiesAction.class),
        };
        return result;
}
 
Example #26
Source File: ConfEGTaskConfNode.java    From BART with MIT License 5 votes vote down vote up
@Override
public Action[] getActions(boolean context) {
        Action[] result = new Action[]{
        Actions.forID("ConfRGTaskConfNode", "it.unibas.bartgui.controlegt.actions.node.ConfEGTNode.Edit"),
        null,
        SystemAction.get(PropertiesAction.class),
        };
        return result;
}
 
Example #27
Source File: DependencyNode.java    From BART with MIT License 5 votes vote down vote up
@Override
public Action[] getActions(boolean context) {
    Action[] result = new Action[]{
        Actions.forID("DependencyNode", 
                "it.unibas.bartgui.controlegt.actions.node.DependenciesNode.Open"),
        null,
        Actions.forID("DependenciesNode", "it.unibas.bartgui.controlegt.actions.node.DependenciesNode.Edit"),
        null,
        SystemAction.get(PropertiesAction.class),
        };
    return result;
}
 
Example #28
Source File: StatisticNode.java    From BART with MIT License 5 votes vote down vote up
@Override
public Action[] getActions(boolean context) {
    
    Action[] a = {
                  Actions.forID("StatisticNode", "it.unibas.bartgui.controlegt.actions.node.Statistics.Open"),
                  Actions.forID("StatisticNode", "it.unibas.bartgui.controlegt.actions.node.Statistics.Export"),
                  null,
                  SystemAction.get(RenameAction.class),
                  SystemAction.get(DeleteAction.class),
                  null,
                  SystemAction.get(PropertiesAction.class),
                  };
    return a;
}
 
Example #29
Source File: JaxWsRootNode.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public Action[] getActions(boolean context) {
    return new Action[]{
        CommonProjectActions.newFileAction(),
        null,
        SystemAction.get(FindAction.class),
        null,
        SystemAction.get(PasteAction.class),
        null,
        SystemAction.get(PropertiesAction.class)
    };
}
 
Example #30
Source File: RepositoryNode.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public Action[] getActions(boolean arg0) {
    return new Action[]{
        // XXX Find
        new RefreshIndexAction(), // XXX allow multiselections
        new EditAction(),
        DeleteAction.get(DeleteAction.class),
        null,
        PropertiesAction.get(PropertiesAction.class)
    };
}