@Override protected void performAction(ItemWsNode context) { WorkspaceItem<TsVariables> cur = (WorkspaceItem<TsVariables>) context.getItem(); if (cur != null && !cur.isReadOnly()) { // create the input dialog String oldName = cur.getDisplayName(), newName; VarsName nd = new VarsName(cur.getFamily(), NAME_MESSAGE, RENAME_TITLE, oldName); nd.addPropertyChangeListener( new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName().equals(NotifyDescriptor.PROP_DETAIL)) {} } }); if (DialogDisplayer.getDefault().notify(nd) != NotifyDescriptor.OK_OPTION) { return; } newName = nd.getInputText(); if (newName.equals(oldName)) return; ProcessingContext.getActiveContext().getTsVariableManagers().rename(oldName, newName); cur.setDisplayName(newName); WorkspaceFactory.Event ev = new WorkspaceFactory.Event( cur.getOwner(), cur.getId(), WorkspaceFactory.Event.ITEMRENAMED); WorkspaceFactory.getInstance().notifyEvent(ev); } }
@Override protected void performAction(ItemWsNode activatedNode) { GregorianCalendarManager manager = ProcessingContext.getActiveContext().getGregorianCalendars(); IGregorianCalendarProvider o = AddCalendarAction.getProvider(activatedNode); if (o instanceof NationalCalendarProvider) { editNationalCalendar(manager, (NationalCalendarProvider) o, activatedNode); } else if (o instanceof ChainedGregorianCalendarProvider) { editChainedCalendar(manager, (ChainedGregorianCalendarProvider) o, activatedNode); } else if (o instanceof CompositeGregorianCalendarProvider) { editCompositeCalendar(manager, (CompositeGregorianCalendarProvider) o, activatedNode); } }