public String getCurrentTabTitle() { String tabTitle = null; try { int pos = house.getSelectedIndex(); if (pos >= 0) { tabTitle = house.getTitleAt(pos); } } catch (Exception e1) { Luyten.showExceptionDialog("Exception!", e1); } if (tabTitle == null) { getLabel().setText("No open tab"); } return tabTitle; }
private void updateTabDisplay(GCResource gcResource) { // enable only "parser" panel, as long as model contains no data boolean modelHasData = gcResource.getModel() != null && gcResource.getModel().size() > 0; for (int i = 0; i < modelChartAndDetailsPanel.getTabCount(); ++i) { modelChartAndDetailsPanel.setEnabledAt(i, modelHasData || modelChartAndDetailsPanel.getTitleAt(i).equals( LocalisationHelper.getString("data_panel_tab_parser"))); } if (!gcResource.isReload()) { if (modelHasData) { modelChartAndDetailsPanel.setSelectedIndex(0); } else { modelChartAndDetailsPanel.setSelectedIndex(modelChartAndDetailsPanel.getTabCount()-1); } } }
String title = getTitleAt(draggedTabIndex); removeTabAt(draggedTabIndex); insertTab(title, null, comp, null, tabNumber);
/** * Returns the label on the "Search" tab. * * @return The text on the "Search" tab. * @see #setSearchTabText */ public final String getSearchTabText() { return tabbedPane.getTitleAt(2); }
/** * Get selected tab name. * * @return name of the selected tab (i.e., sheet name) */ public String getSelectedSheetName() { return tableTabbedPane.getTitleAt(tableTabbedPane.getSelectedIndex()); }
@Override public boolean shouldCloseTab(int tabIndex, JTabbedPane tabbedPane) { int ret = JOptionPane.showConfirmDialog(tabbedPane, String.format("Do you want to close the %s tab?", tabbedPane.getTitleAt(tabIndex)), "Close tab?", JOptionPane.YES_NO_OPTION); return ret == JOptionPane.YES_OPTION; }
public void selectTab(String tabname) { if (tabname == null) return; for (int i = 0; i < tabbedPane.getTabCount(); i++) { if (tabbedPane.getTitleAt(i).equalsIgnoreCase(tabname)) { tabbedPane.setSelectedIndex(i); return; } } }
@Override public String getText() { int index = m_enclosingPane .indexOfTabComponent(CloseableTabTitle.this); if (index >= 0) { return m_enclosingPane.getTitleAt(index); } return null; } };
public String getText() { int i = pane.indexOfTabComponent(ButtonTabComponent.this); if (i != -1) { return pane.getTitleAt(i); } return null; } };
public String getTitleAt(int index) { if (getSelectedIndex() == index) return ""; return super.getTitleAt(index); }
public String getText() { int i = pane.indexOfTabComponent(ButtonTabComponent.this); if (i != -1) { return pane.getTitleAt(i); } return null; } };
public int findTabByName(String title, JTabbedPane tab) { int tabCount = tab.getTabCount(); for (int i=0; i < tabCount; i++) { String tabTitle = tab.getTitleAt(i); if (tabTitle.equals(title)) return i; } return -1; }
private java.util.List<String> getTabNames() { java.util.List<String> result = new ArrayList<String>(); for (int i = 0; i < jTabbedPane.getTabCount(); i++) { result.add(jTabbedPane.getTitleAt(i)); } return result; } }
public void windowDeactivated(WindowEvent evt) { String title = _tabPnl.getTitleAt(_tabPnl.getSelectedIndex()); if (title.equals(s_stringMgr.getString("AboutBoxDialog.system"))) { _systemPnl._memoryPnl.stopTimer(); } } });
/** * Get an info panel with a given name. */ public JComponent getInfoPanel(String name) { JComponent ret = null; for(int i=0; ret==null && i<infopanels.getTabCount(); i++) if(name.equals(infopanels.getTitleAt(i))) ret = (JComponent)infopanels.getComponentAt(i); return ret; }
protected Component getTab(String name) { for(int i = 0; i < tabPane.getTabCount(); i++) { if(tabPane.getTitleAt(i).equals(name)) { return tabPane.getComponentAt(i); } } return null; }
/** Return the row, col of the first object matching the given String. */ private int tabNameToIndex(JTabbedPane tabs, String name) { for (int i=0;i < tabs.getTabCount();i++) { String value = tabs.getTitleAt(i); if (ExtendedComparator.stringsMatch(name, value)) return i; } return -1; }
private void removeStatsTabs() { for (int i = tabbedPane.getTabCount() - 1; i >= 0; i--) { String name = tabbedPane.getTitleAt(i); if (name.equals("Model Statistics")) { tabbedPane.removeTabAt(i); } else if (name.equals("DAG in pattern")) { tabbedPane.removeTabAt(i); } } }
@Override public void actionPerformed(ActionEvent actionEvent) { int tab = tp.getSelectedIndex(); if (tab < 0) tab = 0; new GraphDialog(ValueTableDialog.this, Lang.get("win_testdata_N", tp.getTitleAt(tab)), resultTableData.get(tab)) .disableTable() .setVisible(true); } }.setToolTip(Lang.get("menu_showDataAsGraph_tt"));
@Override public void mouseReleased(MouseEvent e) { if (dragFrom != -1 && dragTo != -1 && dragFrom != dragTo) { playlistManager.movePlaylist(dragFrom, dragTo); Component comp = tabbedPane.getComponentAt(dragFrom); String title = tabbedPane.getTitleAt(dragFrom); tabbedPane.removeTabAt(dragFrom); tabbedPane.insertTab(title, null, comp, null, dragTo); tabbedPane.setSelectedIndex(dragTo); } dragTo = -1; }