Refine search
synchronized (getLock()) { Icon img = (Icon) getProperty(createLabel ? PROP_ICON_TEXTUAL : PROP_ICON); String resName = iconResource(); putProperty(PROP_ICON, img); putProperty(PROP_ICON_TEXTUAL, img); String text = getName(); if (text.endsWith("...")) { // NOI18N text = text.substring(0, text.length() - 3); putProperty(PROP_ICON_TEXTUAL, img); } else { putProperty(PROP_ICON, null);
/** Obtain a singleton instance of the action with a specified class. * If there already is a instance then it is returned, otherwise * a new one is created. * * @param actionClass the class of the action to find * @return the singleton action instance * @exception ClassCastException if the class is not <code>SystemAction</code> * @exception IllegalArgumentException if the instance cannot be created */ public static <T extends SystemAction> T get(Class<T> actionClass) { return findObject(actionClass, true); }
/** Get a property in the singleton. Values are shared among all instances of the same class. * The special tokens {@link Action#NAME}, {@link Action#SMALL_ICON} and "iconBase" are also recognized * and delegated to {@link #getName}, {@link #getIcon} and {@link #iconResource} resp. * @param name the name of the property * @return the value */ public final Object getValue(String name) { if ("iconBase".equals(name)) { // NOI18N return iconResource(); } Object val = getProperty(name); if (val == null) { if (NAME.equals(name)) { val = getName(); } else if (SMALL_ICON.equals(name)) { val = getIcon(); } } return val; }
public Action[] getActions(VCSContext ctx, VCSAnnotator.ActionDestination destination) { Lookup context = ctx.getElements(); List<Action> actions = new ArrayList<Action>(); if (destination == VCSAnnotator.ActionDestination.MainMenu) { actions.add(SystemAction.get(ShowHistoryAction.class)); actions.add(SystemAction.get(RevertDeletedAction.class)); } else { actions.add(SystemActionBridge.createAction( SystemAction.get(ShowHistoryAction.class), NbBundle.getMessage(ShowHistoryAction.class, "CTL_ShowHistory"), context)); actions.add(SystemActionBridge.createAction( SystemAction.get(RevertDeletedAction.class), NbBundle.getMessage(RevertDeletedAction.class, "CTL_ShowRevertDeleted"), context)); } return actions.toArray(new Action[actions.size()]); }
if(a != null) actions.add(a); } else { actions.add(SystemAction.get(StatusAction.class)); actions.add(new DiffMenu(null)); actions.add(SystemAction.get(AddAction.class)); actions.add(SystemAction.get(CommitAction.class)); actions.add(SystemAction.get(UpdateAction.class)); actions.add(SystemAction.get(RevertModificationsAction.class)); actions.add(SystemAction.get(AnnotateAction.class)); actions.add(SystemAction.get(LogAction.class)); actions.add(new ConflictsMenu(null)); actions.add(null); actions.add(new RecoverMenu(null)); actions.add(null); actions.add(SystemAction.get(ViewAction.class)); actions.add(SystemAction.get(PropertiesAction.class)); actions.add(SystemActionBridge.createAction(SystemAction.get(StatusAction.class), loc.getString("CTL_PopupMenuItem_Status"), context)); //NOI18N actions.add(new DiffMenu(context)); actions.add(SystemActionBridge.createAction(SystemAction.get(AddAction.class), NbBundle.getMessage(AddAction.class, "CTL_PopupMenuItem_Add"), context)); //NOI18N actions.add(SystemActionBridge.createAction(SystemAction.get(CommitAction.class), loc.getString("CTL_PopupMenuItem_Commit"), context)); //NOI18N actions.add(SystemActionBridge.createAction(SystemAction.get(UpdateAction.class), loc.getString("CTL_PopupMenuItem_Update"), context)); //NOI18N actions.add(SystemActionBridge.createAction(SystemAction.get(RevertModificationsAction.class), loc.getString("CTL_PopupMenuItem_Revert"), context)); //NOI18N actions.add(SystemActionBridge.createAction(SystemAction.get(AnnotateAction.class), ((AnnotateAction)SystemAction.get(AnnotateAction.class)).visible(nodes) ? loc.getString("CTL_PopupMenuItem_HideAnnotations") //NOI18N : loc.getString("CTL_PopupMenuItem_ShowAnnotations"), context)); //NOI18N actions.add(SystemActionBridge.createAction(SystemAction.get(LogAction.class), loc.getString("CTL_PopupMenuItem_Log"), context)); //NOI18N
(ClassLoader)Lookup.getDefault().lookup(ClassLoader.class) ); SystemAction ac = SystemAction.get (c); if ( version == 0 && isdefault && !defactions[i].equals(ac)) isdefault = false; } catch (ClassNotFoundException ex) { String message = NbBundle.getMessage (DataLoader.class, "EXC_missing_actions_in_loader", getDisplayName ()); ErrorManager.getDefault ().annotate (se, message); throw se;
null, NewTestActionFactory.emptyTestFolderAction(), SystemAction.get(NewFolderAction.class), SystemAction.get(org.openide.actions.FindAction.class), null, SystemAction.get(PropertiesFolderAction.class),}; result = NodeActionFactory.insertAfter(NewTestActionFactory.getTestCreationActions(folder.getProject()), result); } else if (folder.isTestLogicalFolder() && !folder.isDiskFolder()) { null, NewTestActionFactory.emptyTestFolderAction(), SystemAction.get(NewFolderAction.class), SystemAction.get(org.openide.actions.FindAction.class), null, SystemAction.get(RemoveFolderAction.class), NodeActionFactory.createRenameAction(), null, SystemAction.get(PropertiesFolderAction.class),}; result = NodeActionFactory.insertAfter(NewTestActionFactory.getTestCreationActions(folder.getProject()), result); } else if (folder.isTest()) { result = new Action[]{ // SystemAction.get(AddExistingItemAction.class), SystemAction.get(org.openide.actions.FindAction.class), // null, SystemAction.get(RunTestAction.class), SystemAction.get(DebugTestAction.class), SystemAction.get(StepIntoTestAction.class), null,
ll.add(SystemAction.get(c)); } catch (ClassNotFoundException ex) {
/** Get the action's display icon. * @return the icon * @throws IllegalStateException if an icon could not be created */ public final Icon getIcon() { return getIcon(false); }
@Override public String getName() { return systemAction.getName(); } }
public SystemAction[] getSystemActions() { SystemAction[] sa = super.getSystemActions (); try { ClassLoader l = (ClassLoader)org.openide.util.Lookup.getDefault().lookup (ClassLoader.class); if (l == null) l = getClass ().getClassLoader(); Class c = Class.forName ("org.openide.actions.FileSystemAction", true, l); // NOI18N SystemAction ra = (SystemAction) SystemAction.findObject (c, true); // initialize the SYSTEM_ACTIONS sa = SystemAction.linkActions (sa, new SystemAction[] { ra }); } catch (Exception ex) { // ok, we no action like this I guess } return sa; }
@Override public Action[] getActions(boolean context) { Action[] res = new Action[2]; res[0] = new AbstractAction(NbBundle.getMessage(HiddenDataObject.class, "LBL_restore")) { //NOI18N @Override public void actionPerformed(ActionEvent e) { try { destroy(); } catch( IOException ex ) { Exceptions.printStackTrace(ex); } } }; res[0].setEnabled(canDestroy()); res[1] = SystemAction.get(OpenLayerFilesAction.class); return res; } }
@Override public Action[] getActions(boolean context) { return new Action[] { SystemAction.get(OpenResourceAction.class) }; }
/** Get the action's display icon. * @return the icon * @throws IllegalStateException if an icon could not be created */ public final Icon getIcon() { return getIcon(false); }
private JMenuItem createmenuItem(Action action) { JMenuItem item; if (action instanceof SystemAction) { final SystemAction sa = (SystemAction) action; item = new JMenuItem(new AbstractAction(sa.getName()) { public void actionPerformed(ActionEvent e) { sa.actionPerformed(e); } }); } else { item = new JMenuItem(action); } Mnemonics.setLocalizedText(item, (String) action.getValue(Action.NAME)); return item; }
public SystemAction[] getSystemActions() { SystemAction[] sa = super.getSystemActions (); try { ClassLoader l = (ClassLoader)org.openide.util.Lookup.getDefault().lookup (ClassLoader.class); if (l == null) l = getClass ().getClassLoader(); Class c = Class.forName ("org.openide.actions.FileSystemAction", true, l); // NOI18N SystemAction ra = (SystemAction) SystemAction.findObject (c, true); // initialize the SYSTEM_ACTIONS sa = SystemAction.linkActions (sa, new SystemAction[] { ra }); } catch (Exception ex) { // ok, we no action like this I guess } return sa; }
@Override protected void exportPatch (File toFile, File commonParent) throws IOException { support.setDisplayName(NbBundle.getMessage(ShelveChangesAction.class, "MSG_ShelveChanges.progress.exporting")); //NOI18N List<Setup> setups = new ArrayList<Setup>(filteredRoots.size()); for (File file : filteredRoots) { Setup setup = new Setup(file, null, Setup.DIFFTYPE_LOCAL); setups.add(setup); } SystemAction.get(ExportDiffChangesAction.class).exportDiff(setups, toFile, commonParent, support); }
NodeAction globalMoveUp = SystemAction.get(Class.forName("org.openide.actions.MoveUpAction", true, l).asSubclass(NodeAction.class)); // NOI18N NodeAction globalMoveDown = SystemAction.get(Class.forName("org.openide.actions.MoveDownAction", true, l).asSubclass(NodeAction.class)); // NOI18N NodeAction globalNewAction = SystemAction.get(Class.forName("org.openide.actions.NewAction", true, l).asSubclass(NodeAction.class)); // NOI18N java.util.ResourceBundle bundle = NbBundle.getBundle(IndexedEditorPanel.class); treeTableView1.getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_Properties")); newButton.getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_New"));
public Action[] getActions(boolean context){ return new SystemAction[] { SystemAction.get(UndeployModuleAction.class) }; }