javax.swing.JTabbedPane.indexOfTab()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(7.2k)|赞(0)|评价(0)|浏览(115)

本文整理了Java中javax.swing.JTabbedPane.indexOfTab()方法的一些代码示例,展示了JTabbedPane.indexOfTab()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTabbedPane.indexOfTab()方法的具体详情如下:
包路径:javax.swing.JTabbedPane
类名称:JTabbedPane
方法名:indexOfTab

JTabbedPane.indexOfTab介绍

暂无

代码示例

代码示例来源:origin: deathmarine/Luyten

private boolean isTabInForeground(OpenFile open) {
  String title = open.name;
  int selectedIndex = house.getSelectedIndex();
  return (selectedIndex >= 0 && selectedIndex == house.indexOfTab(title));
}

代码示例来源:origin: deathmarine/Luyten

@Override
  public void mouseClicked(MouseEvent e) {
    int index = house.indexOfTab(title);
    closeOpenTab(index);
  }
}

代码示例来源:origin: deathmarine/Luyten

@Override
  public void stateChanged(ChangeEvent e) {
    int selectedIndex = house.getSelectedIndex();
    if (selectedIndex < 0) {
      return;
    }
    for (OpenFile open : hmap) {
      if (house.indexOfTab(open.name) == selectedIndex) {
        if (open.getType() != null && !open.isContentValid()) {
          updateOpenClass(open);
          break;
        }
      }
    }
  }
}

代码示例来源:origin: deathmarine/Luyten

@Override
  public void run() {
    try {
      final String title = open.name;
      RTextScrollPane rTextScrollPane = open.scrollPane;
      if (house.indexOfTab(title) < 0) {
        house.addTab(title, rTextScrollPane);
        house.setSelectedIndex(house.indexOfTab(title));
        int index = house.indexOfTab(title);
        Tab ct = new Tab(title);
        ct.getButton().addMouseListener(new CloseTab(title));
        house.setTabComponentAt(index, ct);
      } else {
        house.setSelectedIndex(house.indexOfTab(title));
      }
      open.onAddedToScreen();
    } catch (Exception e) {
      Luyten.showExceptionDialog("Exception!", e);
    }
  }
});

代码示例来源:origin: deathmarine/Luyten

public void closeFile() {
  for (OpenFile co : hmap) {
    int pos = house.indexOfTab(co.name);
    if (pos >= 0)
      house.remove(pos);
    co.close();
  }
  final State oldState = state;
  Model.this.state = null;
  if (oldState != null) {
    Closer.tryClose(oldState);
  }
  hmap.clear();
  tree.setModel(new DefaultTreeModel(null));
  metadataSystem = new MetadataSystem(typeLoader);
  file = null;
  treeExpansionState = null;
  open = false;
  mainWindow.onFileLoadEnded(file, open);
}

代码示例来源:origin: deathmarine/Luyten

public void run() {
    try {
      Thread.sleep(500);
      String internalName = FindBox.class.getName();
      TypeReference type = metadataSystem.lookupType(internalName);
      TypeDefinition resolvedType = null;
      if ((type == null) || ((resolvedType = type.resolve()) == null)) {
        return;
      }
      StringWriter stringwriter = new StringWriter();
      PlainTextOutput plainTextOutput = new PlainTextOutput(stringwriter);
      plainTextOutput
          .setUnicodeOutputEnabled(decompilationOptions.getSettings().isUnicodeOutputEnabled());
      settings.getLanguage().decompileType(resolvedType, plainTextOutput, decompilationOptions);
      String decompiledSource = stringwriter.toString();
      OpenFile open = new OpenFile(internalName, "*/" + internalName, getTheme(), mainWindow);
      open.setContent(decompiledSource);
      JTabbedPane pane = new JTabbedPane();
      pane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
      pane.addTab("title", open.scrollPane);
      pane.setSelectedIndex(pane.indexOfTab("title"));
    } catch (Exception e) {
      Luyten.showExceptionDialog("Exception!", e);
    }
  }
}.start();

代码示例来源:origin: cytoscape/application

/**
 * Returns the first Component index with given title.
 *
 * @param title Component title.
 * @return int  Component index with given title or -1 if not found.
 */
public int indexOfComponent(String title) {
  // get the index from JTabbedPane
  return tabbedPane.indexOfTab(title);
}

代码示例来源:origin: fcrepo3/fcrepo

private int getTabIndex(String id) {
  int i = m_tabbedPane.indexOfTab(id);
  if (i != -1) {
    return i;
  }
  return m_tabbedPane.indexOfTab(id + "*");
}

代码示例来源:origin: ron190/jsql-injection

tabsSchema.indexOfTab(I18n.valueByKey("SQLENGINE_DATABASES")),
  labelDatabase
);
  tabsSchema.indexOfTab(I18n.valueByKey("SQLENGINE_TABLES")),
  labelTable
);
  tabsSchema.indexOfTab(I18n.valueByKey("SQLENGINE_COLUMNS")),
  labelColumn
);
  tabsSchema.indexOfTab(I18n.valueByKey("SQLENGINE_ROWS")),
  labelRow
);
  tabsSchema.indexOfTab(I18n.valueByKey("SQLENGINE_FIELD")),
  labelField
);
  tabsSchema.indexOfTab(I18n.valueByKey("SQLENGINE_FIELDS_SEPARATOR")),
  labelFieldSeparator
);
  tabsSchema.indexOfTab(I18n.valueByKey("SQLENGINE_METADATA")),
  labelMetadata
);
  tabsStandard.indexOfTab(I18n.valueByKey("SQLENGINE_STANDARD")),

代码示例来源:origin: locationtech/jts

public void showTab(String name)
{
 inputTabbedPane.setSelectedIndex(inputTabbedPane.indexOfTab(name));
}

代码示例来源:origin: openpnp/openpnp

public void showTab(String title) {
  int index = tabs.indexOfTab(title);
  tabs.setSelectedIndex(index);
}

代码示例来源:origin: openpnp/openpnp

private void showTab(String title) {
  int index = tabbedPane.indexOfTab(title);
  tabbedPane.setSelectedIndex(index);
}

代码示例来源:origin: MegaMek/megamek

public void run() {
    int phaseTab = tabs.indexOfTab("Phase");
    if (phaseTab > 0) {
      JViewport vp = ((JScrollPane) tabs.getComponentAt(phaseTab - 1)).getViewport();
      vp.setViewPosition(new Point());
    }
    JViewport vp = ((JScrollPane) tabs.getComponentAt(phaseTab)).getViewport();
    vp.setViewPosition(new Point());
  }
});

代码示例来源:origin: org.apache.jmeter/ApacheJMeter_components

/** {@inheritDoc} */
@Override
public void setupTabPane() {
   // Add xpath tester pane
  if (rightSide.indexOfTab(JMeterUtils.getResString("xpath_tester_title")) < 0) { // $NON-NLS-1$
    rightSide.addTab(JMeterUtils.getResString("xpath_tester_title"), xmlWithXPathPane); // $NON-NLS-1$
  }
  clearData();
}

代码示例来源:origin: org.apache.jmeter/ApacheJMeter_components

/** {@inheritDoc} */
@Override
public void setupTabPane() {
   // Add cssJquery tester pane
  if (rightSide.indexOfTab(JMeterUtils.getResString("cssjquery_tester_title")) < 0) { // $NON-NLS-1$
    rightSide.addTab(JMeterUtils.getResString("cssjquery_tester_title"), cssJqueryPane); // $NON-NLS-1$
  }
  clearData();
}

代码示例来源:origin: org.apache.jmeter/ApacheJMeter_components

/** {@inheritDoc} */
@Override
public void setupTabPane() {
   // Add regexp tester pane
  if (rightSide.indexOfTab(JMeterUtils.getResString("regexp_tester_title")) < 0) { // $NON-NLS-1$
    rightSide.addTab(JMeterUtils.getResString("regexp_tester_title"), regexpPane); // $NON-NLS-1$
  }
  clearData();
}

代码示例来源:origin: org.apache.jmeter/ApacheJMeter_components

/** {@inheritDoc} */
@Override
public void setupTabPane() {
   // Add xpath tester pane
  if (rightSide.indexOfTab(JMeterUtils.getResString("xpath_tester_title")) < 0) { // $NON-NLS-1$
    rightSide.addTab(JMeterUtils.getResString("xpath_tester_title"), xmlWithXPathPane); // $NON-NLS-1$
  }
  clearData();
}

代码示例来源:origin: org.apache.jmeter/ApacheJMeter_components

/** {@inheritDoc} */
@Override
public void setupTabPane() {
   // Add boundaryExtractor tester pane
  if (rightSide.indexOfTab(JMeterUtils.getResString("boundaryextractor_tester_title")) < 0) { // $NON-NLS-1$
    rightSide.addTab(JMeterUtils.getResString("boundaryextractor_tester_title"), boundaryExtractorPane); // $NON-NLS-1$
  }
  clearData();
}

代码示例来源:origin: org.apache.jmeter/ApacheJMeter_components

/** {@inheritDoc} */
@Override
public void setupTabPane() {
   // Add json-path tester pane
  if (rightSide.indexOfTab(JMeterUtils.getResString("jsonpath_tester_title")) < 0) { // $NON-NLS-1$
    rightSide.addTab(JMeterUtils.getResString("jsonpath_tester_title"), jsonWithJSonPathPanel); // $NON-NLS-1$
  }
  clearData();
}

代码示例来源:origin: org.cytoscape/vizmap-gui-impl

public void setSelectedVisualPropertySheet(final VisualPropertySheet sheet) {
  if (sheet != null) {
    final int idx = getPropertiesPn().indexOfTab(sheet.getModel().getTitle());
    
    if (idx != -1)
      getPropertiesPn().setSelectedIndex(idx);
  }
}

相关文章

JTabbedPane类方法