Package com.jidesoft.swing

Examples of com.jidesoft.swing.JideTabbedPane


    private class ContainerHandler implements ContainerListener {
        public void componentAdded(ContainerEvent e) {
            if (_tabPane == null) {
                return;
            }
            JideTabbedPane tp = (JideTabbedPane) e.getContainer();
//            updateTabPanel();
            Component child = e.getChild();
            if (child instanceof UIResource || child == tp.getTabLeadingComponent() || child == tp.getTabTrailingComponent()) {
                return;
            }

            int index = tp.indexOfComponent(child);
            String title = getCurrentDisplayTitleAt(tp, index);
            boolean isHTML = BasicHTML.isHTMLString(title);
            if (isHTML) {
                if (htmlViews == null) { // Initialize vector
                    htmlViews = createHTMLVector();
View Full Code Here


        public void componentRemoved(ContainerEvent e) {
            if (_tabPane == null) {
                return;
            }
            JideTabbedPane tp = (JideTabbedPane) e.getContainer();
//            updateTabPanel();
            Component child = e.getChild();
            if (child instanceof UIResource || child == tp.getTabLeadingComponent() || child == tp.getTabTrailingComponent()) {
                return;
            }

            // NOTE 4/15/2002 (joutwate):
            // This fix is implemented using client properties since there is
            // currently no IndexPropertyChangeEvent. Once
            // IndexPropertyChangeEvents have been added this code should be
            // modified to use it.
            Integer index =
                    (Integer) tp.getClientProperty("__index_to_remove__");
            if (index != null) {
                if (htmlViews != null && htmlViews.size() > index) {
                    htmlViews.removeElementAt(index);
                }
                tp.putClientProperty("__index_to_remove__", null);
            }

            if (_tabPane.isTabEditing()) {
                ((BasicJideTabbedPaneUI) _tabPane.getUI()).stopOrCancelEditing();//_tabPane.stopTabEditing();
            }
View Full Code Here

            super();
            putValue(Action.SHORT_DESCRIPTION, Resource.getResourceBundle(Locale.getDefault()).getString(BUTTON_NAME_CLOSE));
        }

        public void actionPerformed(ActionEvent e) {
            JideTabbedPane pane;
            Object src = e.getSource();
            int index;
            boolean closeSelected = false;
            if (src instanceof JideTabbedPane) {
                pane = (JideTabbedPane) src;
            }
            else if (src instanceof JideTabbedPane.NoFocusButton && ((JideTabbedPane.NoFocusButton) src).getParent() instanceof JideTabbedPane) {
                pane = (JideTabbedPane) ((JideTabbedPane.NoFocusButton) src).getParent();
                closeSelected = true;
            }
            else if (src instanceof JideTabbedPane.NoFocusButton && ((JideTabbedPane.NoFocusButton) src).getParent() instanceof ScrollableTabPanel) {
                pane = (JideTabbedPane) SwingUtilities.getAncestorOfClass(JideTabbedPane.class, (JideTabbedPane.NoFocusButton) src);
                closeSelected = false;
            }
            else {
                return; // shouldn't happen
            }

            if (pane.isTabEditing()) {
                ((BasicJideTabbedPaneUI) pane.getUI()).stopOrCancelEditing();//pane.stopTabEditing();
            }

            ActionEvent e2 = e;
            if (src instanceof JideTabbedPane.NoFocusButton) {
                index = ((JideTabbedPane.NoFocusButton) src).getIndex();
                Component compSrc = index != -1 ? pane.getComponentAt(index) : pane.getSelectedComponent();
                // note - We create a new action because we could be in the middle of a chain and
                // if we just use setSource we could cause problems.
                // also the AWT documentation pooh-pooh this. (for good reason)
                if (compSrc != null)
                    e2 = new ActionEvent(compSrc, e.getID(), e.getActionCommand(), e.getWhen(), e.getModifiers());
            }
            else if ("middleMouseButtonClicked".equals(e.getActionCommand())) {
                index = e.getID();
                Component compSrc = index != -1 ? pane.getComponentAt(index) : pane.getSelectedComponent();
                // note - We create a new action because we could be in the middle of a chain and
                // if we just use setSource we could cause problems.
                // also the AWT documentation pooh-pooh this. (for good reason)
                if (compSrc != null)
                    e2 = new ActionEvent(compSrc, e.getID(), e.getActionCommand(), e.getWhen(), e.getModifiers());
            }

            if (pane.getCloseAction() != null) {
                e2 = new ActionEvent(e2.getSource(), e2.getID(), (String) pane.getCloseAction().getValue(Action.ACTION_COMMAND_KEY), e2.getWhen(), e2.getModifiers());
                pane.getCloseAction().actionPerformed(e2);
            }
            else {
                if ("middleMouseButtonClicked".equals(e.getActionCommand())) {
                    index = e.getID();
                    if (index >= 0)
                        pane.removeTabAt(index);
                    if (pane.getTabCount() == 0) {
                        pane.updateUI();
                    }
                    pane.doLayout();
                    if (pane.getSelectedIndex() >= 0) {
                        ((BasicJideTabbedPaneUI) pane.getUI())._tabScroller.tabPanel.scrollIndexToVisible(pane.getSelectedIndex());
                    }
                }
                else if (closeSelected) {
                    if (pane.getSelectedIndex() >= 0)
                        pane.removeTabAt(pane.getSelectedIndex());
                    if (pane.getTabCount() == 0) {
                        pane.updateUI();
                    }
                    pane.doLayout();
                    if (pane.getSelectedIndex() >= 0) {
                        ((BasicJideTabbedPaneUI) pane.getUI())._tabScroller.tabPanel.scrollIndexToVisible(pane.getSelectedIndex());
                    }
                }
                else if (src instanceof JideTabbedPane.NoFocusButton) {
                    int i = ((JideTabbedPane.NoFocusButton) src).getIndex();
                    if (i != -1) {

                        int tabIndex = pane.getSelectedIndex();

                        pane.removeTabAt(i);

                        if (i < tabIndex) {
                            pane.setSelectedIndex(tabIndex - 1);
                        }

                        if (pane.getTabCount() == 0) {
                            pane.updateUI();
                        }
                        pane.doLayout();
                        if (pane.getSelectedIndex() >= 0) {
                            ((BasicJideTabbedPaneUI) pane.getUI())._tabScroller.tabPanel.scrollIndexToVisible(pane.getSelectedIndex());
                        }
                    }
                }
            }
        }
View Full Code Here

          // double clicks on the tabs of DocumentPane. This comes from the JIDE
          // demos
              protected IDocumentGroup createDocumentGroup() {
                  IDocumentGroup group = super.createDocumentGroup();
                  if (group instanceof JideTabbedPane) {
                    JideTabbedPane tabbedPane = (JideTabbedPane)group;
                    tabbedPane.addMouseListener(tabDoubleClickListener);
                      //((JideTabbedPaneUI) ((JideTabbedPane) group).getUI()).getTabPanel().
                      //    addMouseListener(tabDoubleClickListener);
                  }
                  return group;
              }
View Full Code Here

   {
      try
      {
         model = HermesBrowser.getBrowser().getConfig();

         topPanel = new JideTabbedPane();
         sessionPanel = new JPanel();
         factoryPanel = new JPanel();

         for (Iterator iter = model.getFactory().iterator(); iter.hasNext();)
         {
View Full Code Here

   
    this.panelTasks = new JPanel();
    add(this.panelTasks, BorderLayout.WEST);
    this.panelTasks.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
   
    this.tabbedPaneContents = new JideTabbedPane(JTabbedPane.TOP);
    this.tabbedPaneContents.setUseDefaultShowCloseButtonOnTab(true);
    add(this.tabbedPaneContents, BorderLayout.CENTER);
  }
View Full Code Here

   * Create the panel.
   */
  public TabbedView() {
    setLayout(new BorderLayout(0, 0));
   
    this.jideTabbedPane = new JideTabbedPane();
    this.jideTabbedPane.setShowCloseButtonOnTab(true);
    this.jideTabbedPane.setTabShape(1);
    this.jideTabbedPane.setColorTheme(4);
    this.jideTabbedPane.setBoldActiveTab(true);
    add(this.jideTabbedPane, BorderLayout.CENTER);
View Full Code Here

    private void initComponents() {
        this.setTitle("Trader's Diary");
        headerPanel = new JPanel();
        mainPanel = new JPanel();
        tabbedPane = new JideTabbedPane();

        table = new JTable();
        // table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
        table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
View Full Code Here


  @Override
  public JTabbedPane createTabbedPane() {
    //            return super.createTabbedPane();
    JideTabbedPane tabbedPane = new JideTabbedPane();
    tabbedPane.setBoldActiveTab( true );
    tabbedPane.setShowTabArea( true );
    tabbedPane.setHideOneTab( false );
    tabbedPane.setContentBorderInsets( new InsetsUIResource( 2, 2, 2, 2 ) );

    return tabbedPane;
  }
View Full Code Here

TOP

Related Classes of com.jidesoft.swing.JideTabbedPane

Copyright © 2018 www.massapicom. 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.