Package javax.swing

Examples of javax.swing.JTabbedPane.indexOfComponent()


    public static void setComponentTabIcon(Component component, Icon icon) {
        Component parent = component.getParent();
        while (parent != null) {
            if (parent instanceof JTabbedPane) {
                JTabbedPane tabbedPane = (JTabbedPane) parent;
                int index = tabbedPane.indexOfComponent(component);
                tabbedPane.setIconAt(index, icon);
                break;
            }
            component = parent;
            parent = parent.getParent();
View Full Code Here


    if (addMethodName.equals("addTab")) {
      JTabbedPane jtp = (JTabbedPane) adaptable.getWidget();
      List arguments = mi.arguments();
      if (arguments.size() > 2) {
        Component child = getTabComponent(mi, arguments);
        int index = jtp.indexOfComponent(child);
        if (index != -1) {
          Icon icon = jtp.getIconAt(index);
          if (icon != null) {
            Expression exp = (Expression) arguments.get(1);
            icon = parseIcon(icon, exp);
View Full Code Here

  }

  @Override
  public int getIndexOfChild(Component child) {
    JTabbedPane tp = (JTabbedPane) getWidget();
    return tp.indexOfComponent(child);
  }

  @Override
  public boolean isChildVisible(Component child) {
    JTabbedPane tp = (JTabbedPane) getWidget();
View Full Code Here

  }

  @Override
  public Object getChildConstraints(Component child) {
    JTabbedPane jtp = (JTabbedPane) getWidget();
    int index = jtp.indexOfComponent(child);
    if (index != -1)
      return jtp.getTitleAt(index);
    else
      return null;
  }
View Full Code Here

    }
 
    @Override
    public void run() {
      JTabbedPane jtp=(JTabbedPane) adaptable.getWidget();
      int index = jtp.indexOfComponent(child);
      if(index!=-1){
        TabPropertiesDialog tpd = new TabPropertiesDialog(JavaUtil.getEclipseShell());
        tpd.setTitle(jtp.getTitleAt(index));
        tpd.setTooltip(jtp.getToolTipTextAt(index));
        Icon icon = jtp.getIconAt(index);
View Full Code Here

//                      setCaption(gf, mcat.getString(msgSet, msgNumber));
                        Caption.set(gf, mcat.getString(msgSet, msgNumber));
                    }
                    if ((gf.getParent() != null) && (gf.getParent() instanceof JTabbedPane)) {
                        JTabbedPane jt = (JTabbedPane) comp.getParent();
                        int index = jt.indexOfComponent(comp);
                        if (index != -1) {
                            jt.setTitleAt(index, mcat.getString(msgSet, msgNumber, jt.getTitleAt(index)));
                        }
                    }
View Full Code Here

//                      setCaption(gf, mcat.getString(msgSet, msgNumber));
                        Caption.set(gf, mcat.getString(msgSet, msgNumber));
                    }
                    if ((gf.getParent() != null) && (gf.getParent() instanceof JTabbedPane)) {
                        JTabbedPane jt = (JTabbedPane) comp.getParent();
                        int index = jt.indexOfComponent(comp);
                        if (index != -1) {
                            jt.setTitleAt(index, mcat.getString(msgSet, msgNumber, jt.getTitleAt(index)));
                        }
                    }
View Full Code Here

         * TabFolder
         */
        if (comp instanceof JTabbedPane) {
          JTabbedPane tp = (JTabbedPane)comp;
          // NB: Do not use getSelectedIndex() because the index has already changed at this point
          int index = tp.indexOfComponent(oldComp);
          s.push(new TabFocus(tp, index));
        }
        /*
         * TextField
         */
 
View Full Code Here

         * TabFolder
         */
        if (comp instanceof JTabbedPane) {
          JTabbedPane tp = (JTabbedPane)comp;
          // NB: Do not use getSelectedIndex() because the index has already changed at this point
          int index = tp.indexOfComponent(oldComp);
          s.push(new TabFocus(tp, index));
        }
        /*
         * TextField
         */
 
View Full Code Here

   
    // workaround to update icon of tab
    Component c = getParent();
      if (c instanceof JTabbedPane) {
        JTabbedPane tab = (JTabbedPane) c;
        int index = tab.indexOfComponent(this);
        tab.setIconAt(index, icon);
      }
  }

  @Override
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.