Esempio n. 1
0
  private void insertTabImpl(String title, Icon icon, Component component, String tip, int index) {
    String tabid = component.getName();
    if (tabid == null) {
      tabid = "WIN" + new java.rmi.server.UID();
      component.setName(tabid);
    }

    Component old = tabIndex.get(tabid);
    if (old != null) {
      if (indexOfComponent(old) >= 0) {
        setSelectedComponent(old);
        return;
      }
    }

    if (component instanceof OSTabbedView) {
      String s = ((OSTabbedView) component).getTitle();
      if (s != null && s.trim().length() > 0) {
        title = s;
      }
    }

    super.insertTab(title, icon, component, tip, index);
    setSelectedIndex(index);
    tabIndex.put(tabid, component);
    OSManager.getInstance().registerView(tabid, new OSViewImpl(component));
  }
Esempio n. 2
0
 public void removeAll() {
   super.removeAll();
   tabIndex.clear();
 }