public void evaluate() { try { // clear problems and console messages problemsView.setText(""); consoleView.setText(""); // update status view statusView.setText(" Parsing ..."); tabbedPane.setSelectedIndex(0); LispExpr root = Parser.parse(textView.getText()); statusView.setText(" Running ..."); tabbedPane.setSelectedIndex(1); // update run button runButton.setIcon(stopImage); runButton.setActionCommand("Stop"); // start run thread runThread = new RunThread(root); runThread.start(); } catch (SyntaxError e) { tabbedPane.setSelectedIndex(0); System.err.println( "Syntax Error at " + e.getLine() + ", " + e.getColumn() + " : " + e.getMessage()); } catch (Error e) { // parsing error System.err.println(e.getMessage()); statusView.setText(" Errors."); } }
public boolean popdnTool(String name) { JComponent obj = searchTool(name); if (obj == null) return false; if (obj instanceof VToolPanel) { if (!((VToolPanel) obj).popdnTool(name)) return false; } else { if (obj instanceof PushpinIF) { PushpinIF pobj = (PushpinIF) obj; pobj.pinPopup(false); } boolean bContain = containTool(obj); if (!bContain) return false; } bChangeTool = true; setCurrentLayout(); if (previous_selectedTab >= 1 && tabbedPane != null) { if (tabbedPane.getTabCount() > previous_selectedTab) tabbedPane.setSelectedIndex(previous_selectedTab); } VnmrjIF vif = Util.getVjIF(); if (vif != null) vif.raiseToolPanel(false); if (!pinPanel.isOpen()) pinPanel.setVisible(false); bChangeTool = false; updateSelectedObj(); repaint(); return true; }
public TdsMonitor(ucar.util.prefs.PreferencesExt prefs, JFrame parentFrame) throws HTTPException { this.mainPrefs = prefs; this.parentFrame = parentFrame; makeCache(); fileChooser = new FileManager(parentFrame, null, null, (PreferencesExt) prefs.node("FileManager")); // the top UI tabbedPane = new JTabbedPane(JTabbedPane.TOP); managePanel = new ManagePanel((PreferencesExt) mainPrefs.node("ManageLogs")); accessLogPanel = new AccessLogPanel((PreferencesExt) mainPrefs.node("LogTable")); servletLogPanel = new ServletLogPanel((PreferencesExt) mainPrefs.node("ServletLogPanel")); urlDump = new URLDumpPane((PreferencesExt) mainPrefs.node("urlDump")); tabbedPane.addTab("ManageLogs", managePanel); tabbedPane.addTab("AccessLogs", accessLogPanel); tabbedPane.addTab("ServletLogs", servletLogPanel); tabbedPane.addTab("UrlDump", urlDump); tabbedPane.setSelectedIndex(0); setLayout(new BorderLayout()); add(tabbedPane, BorderLayout.CENTER); CredentialsProvider provider = new UrlAuthenticatorDialog(null); session = new HTTPSession("TdsMonitor"); session.setCredentialsProvider(provider); session.setUserAgent("TdsMonitor"); }
protected void showFirstPage() { if (tabbedPanel.getTabCount() <= 0) cardLayout.show(finalPanel, "FirstPanel"); else { cardLayout.show(finalPanel, "TabbedPanel"); tabbedPanel.setSelectedIndex(0); } }
private void updateEditorView() { editorPane.setText(""); numParameters = 0; try { java.util.List elements = editableTemplate.getPrintfElements(); for (Iterator it = elements.iterator(); it.hasNext(); ) { PrintfUtil.PrintfElement el = (PrintfUtil.PrintfElement) it.next(); if (el.getFormat().equals(PrintfUtil.PrintfElement.FORMAT_NONE)) { appendText(el.getElement(), PLAIN_ATTR); } else { insertParameter( (ConfigParamDescr) paramKeys.get(el.getElement()), el.getFormat(), editorPane.getDocument().getLength()); } } } catch (Exception ex) { JOptionPane.showMessageDialog( this, "Invalid Format: " + ex.getMessage(), "Invalid Printf Format", JOptionPane.ERROR_MESSAGE); selectedPane = 1; printfTabPane.setSelectedIndex(selectedPane); updatePane(selectedPane); } }
/** Refreshes the currently visible editor with new info. */ public void refreshEditors(DXEntry entry, DataBrokerQueryInterface ds) { if (currentEditor != null) { this.entry = entry; // TE: make sure everything is in sink. dataSource = ds; currentEditor.getDataSink().displayEntry(entry, ds); // checks for unsaved changes... // check that the editor hasn't changed display component JComponent display = currentEditor.getDisplayComponent(); // XXX hack alert - some editor writers change their display component // XXX mid-flight, and expect JX to magically notice, and change the // XXX the display. This code attempts to do this. if (indexOfComponent(display) == -1) // we have a problem - the display component has changed { String title = currentEditor.getName(); ImageIcon icon = currentEditor.getIcon(); String toolTip = currentEditor.getToolTip(); int index = getSelectedIndex(); // find the index of the editor (XXX - this relies on the // activeEditor vector tracking the inherent tab pane order) super.remove(index); super.insertTab(title, icon, display, toolTip, index); super.setSelectedIndex(index); } } else log.warning("internal error - no editor available in AttributeDisplay"); }
private void setSelectedTab(int id, String name) { if (tabbedPane == null) return; int selectId = id; if (name != null) { for (int k = 0; k < tabbedPane.getTabCount(); k++) { String tabName = tabbedPane.getTitleAt(k); if (name.equals(tabName)) { selectId = k; break; } } } if (selectId >= 0 && selectId < tabbedPane.getTabCount()) tabbedPane.setSelectedIndex(selectId); }
public void showFrame(Editor editor, ContributionType contributionType) { this.editor = editor; // Calculating index to switch to the required tab int index = getIndex(contributionType); if (dialog == null) { makeFrame(editor); // done before as downloadAndUpdateContributionListing() // requires the current selected tab tabbedPane.setSelectedIndex(index); downloadAndUpdateContributionListing(editor.getBase()); if (index != 4) { Component selected = tabbedPane.getTabComponentAt(tabbedPane.getSelectedIndex()); selected.setBackground(new Color(0xe0fffd)); selected.setForeground(Color.BLACK); } else { updateTabPanel.setBackground(new Color(0xe0fffd)); updateTabLabel.setForeground(Color.BLACK); } } tabbedPane.setSelectedIndex(index); dialog.setVisible(true); }
private void createUI() { memLabel = new JLabel("####", JLabel.RIGHT); JTabbedPane tabbedPane = new JTabbedPane(); setComponentName(tabbedPane, "TabbedPane"); spatialSubsetPane = createSpatialSubsetPane(); setComponentName(spatialSubsetPane, "SpatialSubsetPane"); if (spatialSubsetPane != null) { tabbedPane.addTab("Spatial Subset", spatialSubsetPane); /*I18N*/ } bandSubsetPane = createBandSubsetPane(); setComponentName(bandSubsetPane, "BandSubsetPane"); if (bandSubsetPane != null) { tabbedPane.addTab("Band Subset", bandSubsetPane); } tiePointGridSubsetPane = createTiePointGridSubsetPane(); setComponentName(tiePointGridSubsetPane, "TiePointGridSubsetPane"); if (tiePointGridSubsetPane != null) { tabbedPane.addTab("Tie-Point Grid Subset", tiePointGridSubsetPane); } metadataSubsetPane = createAnnotationSubsetPane(); setComponentName(metadataSubsetPane, "TiePointGridSubsetPane"); if (metadataSubsetPane != null) { tabbedPane.addTab("Metadata Subset", metadataSubsetPane); } tabbedPane.setPreferredSize(new Dimension(512, 380)); tabbedPane.setSelectedIndex(0); JPanel contentPane = new JPanel(new BorderLayout(4, 4)); setComponentName(contentPane, "ContentPane"); contentPane.add(tabbedPane, BorderLayout.CENTER); contentPane.add(memLabel, BorderLayout.SOUTH); setContent(contentPane); updateSubsetDefNodeNameList(); }
public void setSelectedTab(int pos) { tabbedPane.setSelectedIndex(pos); }
private void gotoUrlDump(String urlString) { urlDump.setURL(urlString); tabbedPane.setSelectedIndex(3); }