private JPanel createToolbarPanel() { RunAction runAction = new RunAction(this); runAction.registerCustomShortcutSet(CommonShortcuts.getRerun(), this); DefaultActionGroup leftActionGroup = new DefaultActionGroup(); leftActionGroup.add(runAction); leftActionGroup.add(new PauseOutputAction(this)); leftActionGroup.add(new StopAction(this)); leftActionGroup.add(new CloseAction()); leftActionGroup.add(new PreviousOccurenceToolbarAction(this)); leftActionGroup.add(new NextOccurenceToolbarAction(this)); leftActionGroup.add(new ContextHelpAction(HelpID.ANT)); DefaultActionGroup rightActionGroup = new DefaultActionGroup(); rightActionGroup.add(new ChangeViewAction(this)); rightActionGroup.add(new VerboseAction(this)); rightActionGroup.add( CommonActionsManager.getInstance().createExpandAllAction(myTreeExpander, this)); rightActionGroup.add( CommonActionsManager.getInstance().createCollapseAllAction(myTreeExpander, this)); rightActionGroup.add(myTreeView.createToggleAutoscrollAction()); myLeftToolbar = ActionManager.getInstance() .createActionToolbar(ActionPlaces.ANT_MESSAGES_TOOLBAR, leftActionGroup, false); JPanel toolbarPanel = new JPanel(new GridLayout(1, 2, 2, 0)); toolbarPanel.add(myLeftToolbar.getComponent()); myRightToolbar = ActionManager.getInstance() .createActionToolbar(ActionPlaces.ANT_MESSAGES_TOOLBAR, rightActionGroup, false); toolbarPanel.add(myRightToolbar.getComponent()); return toolbarPanel; }
public void emptyAll() { myLog.clear(); myCommandsProcessedCount = 0; myErrorCount = 0; myWarningCount = 0; myPlainTextView.clearAllMessages(); myTreeView.clearAllMessages(); }
@Override public void run() { if (myTreeView != null && myCommandsProcessedCount < myLog.size()) { if (!myIsOutputPaused) { new OutputFlusher().doFlush(); myTreeView.scrollToLastMessage(); } } }
private void resetState() { if (treeView != null) { treeView.dispose(); treeView = null; } isOpen = false; idxName = null; setGuiState(INITSTATE); // setTitle("amdb"); setTree(""); wkldStatsDlg.setVisible(false); splitStatsDlg.setVisible(false); penaltyStatsDlg.setVisible(false); }
private synchronized void changeDetalizationLevel(int priorityThreshold) { myPriorityThreshold = priorityThreshold; TreeView.TreeSelection selection = myTreeView.getSelection(); myTreeView.clearAllMessages(); myPlainTextView.clearAllMessages(); myTreeView.setActionsEnabled(false); new OutputFlusher() { public void doFlush() { final int processedCount = myCommandsProcessedCount; for (int i = 0; i < processedCount; i++) { LogCommand command = myLog.get(i); proceedOneCommand(command); } flushDelayedMessages(); } }.doFlush(); myTreeView.setActionsEnabled(true); if (!myTreeView.restoreSelection(selection)) { myTreeView.scrollToLastMessage(); } }
public boolean hasPreviousOccurence() { return isTreeView() && myTreeView.hasPreviousOccurence(); }
public boolean hasNextOccurence() { return isTreeView() && myTreeView.hasNextOccurence(); }
public OccurenceInfo goPreviousOccurence() { return isTreeView() ? myTreeView.goPreviousOccurence() : null; }
public OccurenceInfo goNextOccurence() { return isTreeView() ? myTreeView.goNextOccurence() : null; }
public String getPreviousOccurenceActionName() { return myTreeView.getPreviousOccurenceActionName(); }
public String getNextOccurenceActionName() { return myTreeView.getNextOccurenceActionName(); }
private void expandAll() { myTreeView.expandAll(); }
private void collapseAll() { myTreeView.collapseAll(); }
public void updateGuiState(int priorState, LibgistCommand cmd, boolean success) { switch (cmd.cmdType) { case LibgistCommand.CREATE: case LibgistCommand.OPEN: resetState(); if (!success) return; // done setGuiState(IDXOPENSTATE); isOpen = true; idxName = cmd.indexName.toString(); if (cmd.cmdType == LibgistCommand.CREATE) { resetConfig(); } else { restoreConfig(); } // setTitle("amdb: " + filename); setTree(idxName); try { treeView = new TreeView(desktop); // creates a display of the opened index desktop.add(treeView, JLayeredPane.PALETTE_LAYER); } catch (LibgistException e) { // what to do now? consoleFrame.echoInfo("new TreeView() failed"); } break; case LibgistCommand.CLOSE: saveConfig(); resetState(); break; case LibgistCommand.OPENANL: resetState(); if (!success) return; // done // enable menu items and open tree view setGuiState(ANLOPENSTATE); // setTitle("amdb: " + filename); setTree(idxName); try { treeView = new TreeView(desktop); // creates a display of the opened index desktop.add(treeView, JLayeredPane.PALETTE_LAYER); } catch (LibgistException e) { // what to do now? consoleFrame.echoInfo("new TreeView() failed"); } // get ready to display dialogs if (analysisInfo.actualHasWkldStats) { wkldStatsDlg.init(treeView); } if (analysisInfo.actualHasSplitStats) { splitStatsDlg.init(treeView); } if (analysisInfo.actualHasPenaltyStats) { penaltyStatsDlg.init(treeView); } break; case LibgistCommand.CLOSEANL: treeView.dispose(); treeView = null; setGuiState(INITSTATE); setTree(""); break; // if these didn't work, we don't care case LibgistCommand.INSERT: case LibgistCommand.REMOVE: case LibgistCommand.FETCH: case LibgistCommand.FLUSH: case LibgistCommand.CREATEANL: case LibgistCommand.SCRIPT: setGuiState(priorState); break; } }
// tiles treeView, globalView and consoleFrame public void tile() { if (treeView != null) treeView.tile(); consoleFrame.tile(); }