/** {@inheritDoc} */ @Override public void run() { CreateChapterPopupMenuAction.LOGGER.debug(CmnStringUtil.EMPTY); InputDialog inputDialog = new InputDialog( PluginUtil.getActiveWorkbenchShell(), ResourceUtil.inputChapterSubject, ResourceUtil.inputChapterName, null, null); if (inputDialog.open() == InputDialog.OK) { // Pretreatment TreeViewer entryViewer = (TreeViewer) treeViewer; Object[] expandedNodes = entryViewer.getExpandedElements(); entryViewer.getTree().setRedraw(false); // Entry Processing List<EntryOperator> entryList = treeViewer.getInputEntry(); ChapterEntry chapter = new ChapterEntry(); chapter.setKey(ResourceUtil.dummyChapterID); chapter.setName(inputDialog.getValue()); chapter.setLevel(0); entryList.add(chapter); treeViewer.setEntryListData(entryList); // Post-processing treeViewer.refreshTreeViewer(true); entryViewer.setExpandedElements(expandedNodes); entryViewer.getTree().setRedraw(true); } CreateChapterPopupMenuAction.LOGGER.info( MessagePropertiesUtil.getMessage(MessagePropertiesUtil.LOG_CREATE_CONTEXTMENULIST)); }
/** * Constructor.<br> * * @param treeViewer Access to treeViewer */ public CreateChapterPopupMenuAction(EditorTreeViewerOperator treeViewer) { super(); this.treeViewer = treeViewer; CreateChapterPopupMenuAction.LOGGER.debug("[treeViewer]" + treeViewer); }