Package org.noos.xing.mydoggy

Examples of org.noos.xing.mydoggy.ToolWindowTab


        initTabs();
    }

    protected void initTabs() {
        ToolWindow debugTool = toolWindowManager.getToolWindow("Debug");
        ToolWindowTab profilingTab = debugTool.addToolWindowTab("Profiling", new JButton("Profiling"));
        profilingTab.setCloseable(true);
    }
View Full Code Here


                dtde.acceptDrop(DnDConstants.ACTION_MOVE);

                // Chech if it was a tab
                if (transferable.isDataFlavorSupported(MyDoggyTransferable.TOOL_WINDOW_TAB_ID_DF)) {
                    // Remove from tab
                    ToolWindowTab tab = (ToolWindowTab) manager.getDockable(
                            transferable.getTransferData(MyDoggyTransferable.TOOL_WINDOW_TAB_ID_DF)
                    );
                    tab.getOwner().removeToolWindowTab(tab);

                    toolWindow = (ToolWindow) tab.getDockableDelegator();
                    toolWindow.setAnchor(anchor, index);
                    toolWindow.setActive(true);
                } else {
                    boolean oldAggregateMode = toolWindow.isAggregateMode();
                    toolWindow.setAggregateMode(true);
View Full Code Here

    }

    public void propertyChange(PropertyChangeEvent evt) {
        String property = evt.getPropertyName();
        if ("selected".equals(property)) {
            ToolWindowTab tab = (ToolWindowTab) evt.getSource();
            if (evt.getNewValue() == Boolean.TRUE) {
                if (selectedTab != null)
                    selectedTab.setSelected(false);
                selectedTab = tab;
            }
View Full Code Here

                public CloseAllTabAction() {
                    super(descriptor.getResourceManager().getString("@@tool.tab.closeAll"));
                }

                public void actionPerformed(ActionEvent e) {
                    ToolWindowTab selectedTab = null;

                    for (ToolWindowTab tab : toolWindow.getToolWindowTabs()) {
                        if (tab.isSelected()) {
                            selectedTab = tab;
                            continue;
                        }
                        tryToClose(tab);
                    }

                    tryToClose(selectedTab);
                }

                protected void tryToClose(ToolWindowTab tab) {
                    if (tab != null && tab.isCloseable()) {
                        ToolWindowTabEvent event = new ToolWindowTabEvent(this, ToolWindowTabEvent.ActionId.TAB_REMOVING,
                                                                          toolWindow, tab);

                        for (ToolWindowListener listener : toolWindow.getToolWindowListeners()) {
                            boolean result = listener.toolWindowTabRemoving(event);
                            if (!result)
                                break;
                        }

                        toolWindow.removeToolWindowTab(tab);
                    }
                }
            }

        });
        toolWindow.addToolWindowListener(new ToolWindowListener() {
            public void toolWindowTabAdded(ToolWindowTabEvent event) {
                if (tabContainer.getComponentCount() == 0)
                    initTabs();
                else
                    addTab(event.getToolWindowTab());

                checkPopupButton();
            }

            public boolean toolWindowTabRemoving(ToolWindowTabEvent event) {
                return true;
            }

            public void toolWindowTabRemoved(ToolWindowTabEvent event) {
                ToolWindowTab nextTab = removeTab(event.getToolWindowTab());

                if (event.getToolWindowTab().isSelected()) {
                    ToolWindowTab[] tabs = toolWindow.getToolWindowTabs();
                    if (tabs.length > 0) {
                        if (nextTab != null)
                            nextTab.setSelected(true);
                        else
                            tabs[0].setSelected(true);
                    }
                }
View Full Code Here

                public CloseAllTabAction() {
                    super(descriptor.getResourceManager().getString("@@tool.tab.closeAll"));
                }

                public void actionPerformed(ActionEvent e) {
                    ToolWindowTab selectedTab = null;

                    for (ToolWindowTab tab : toolWindow.getToolWindowTabs()) {
                        if (tab.isSelected()) {
                            selectedTab = tab;
                            continue;
View Full Code Here

    }

    public void propertyChange(PropertyChangeEvent evt) {
        updateModel();

        ToolWindowTab toolWindowTab = (ToolWindowTab) evt.getSource();
        if (toolWindowTabs != null) {
            for (int i = 0; i < toolWindowTabs.length; i++) {
                if (toolWindowTab == toolWindowTabs[i]) {
                    fireTableRowsUpdated(i, i);
                    return;
View Full Code Here

    }

    public void propertyChange(PropertyChangeEvent evt) {
        String property = evt.getPropertyName();
        if ("selected".equals(property)) {
            ToolWindowTab tab = (ToolWindowTab) evt.getSource();
            if (evt.getNewValue() == Boolean.TRUE) {
                if (selectedTab != null)
                    selectedTab.setSelected(false);
                selectedTab = tab;
            }
View Full Code Here

                public CloseAllTabAction() {
                    super(ResourceBoundles.getResourceBundle().getString("@@tool.tab.closeAll"));
                }

                public void actionPerformed(ActionEvent e) {
                    ToolWindowTab selectedTab = null;

                    for (ToolWindowTab tab : toolWindow.getToolWindowTabs()) {
                        if (tab.isSelected()) {
                            selectedTab = tab;
                            continue;
                        }
                        tryToClose(tab);
                    }

                    tryToClose(selectedTab);
                }

                protected void tryToClose(ToolWindowTab tab) {
                    if (tab != null && tab.isCloseable()) {
                        ToolWindowTabEvent event = new ToolWindowTabEvent(this, ToolWindowTabEvent.ActionId.TAB_REMOVING,
                                                                          toolWindow, tab);

                        for (ToolWindowListener listener : toolWindow.getToolWindowListeners()) {
                            boolean result = listener.toolWindowTabRemoving(event);
                            if (!result)
                                break;
                        }

                        toolWindow.removeToolWindowTab(tab);
                    }
                }
            }

        });
        toolWindow.addToolWindowListener(new ToolWindowListener() {
            public void toolWindowTabAdded(ToolWindowTabEvent event) {
                if (tabContainer.getComponentCount() == 0)
                    initTabs();
                else
                    addTab(event.getToolWindowTab());

                setPopupButtonVisibility();
            }

            public boolean toolWindowTabRemoving(ToolWindowTabEvent event) {
                return true;
            }

            public void toolWindowTabRemoved(ToolWindowTabEvent event) {
                ToolWindowTab nextTab = removeTab(event.getToolWindowTab());

                if (event.getToolWindowTab().isSelected()) {
                    ToolWindowTab[] tabs = toolWindow.getToolWindowTabs();
                    if (tabs.length > 0) {
                        if (nextTab != null)
                            nextTab.setSelected(true);
                        else
                            tabs[0].setSelected(true);
                    }
                }
View Full Code Here

                public CloseAllTabAction() {
                    super(ResourceBoundles.getResourceBundle().getString("@@tool.tab.closeAll"));
                }

                public void actionPerformed(ActionEvent e) {
                    ToolWindowTab selectedTab = null;

                    for (ToolWindowTab tab : toolWindow.getToolWindowTabs()) {
                        if (tab.isSelected()) {
                            selectedTab = tab;
                            continue;
View Full Code Here

        public boolean toolWindowTabRemoving(ToolWindowTabEvent event) {
            return true;
        }

        public void toolWindowTabRemoved(ToolWindowTabEvent event) {
            ToolWindowTab toolWindowTab = event.getToolWindowTab();

            // Store support fields
            boolean isSelected = toolWindowTab.isSelected();
            ToolWindowTab nextTab = (isSelected) ? getNextTab(toolWindowTab) : null;

            // Remove the tab
            removeTab(event.getToolWindowTab(), true);

            // Select the next if necessary
            if (isSelected) {
                if (nextTab != null) {
                    nextTab.setSelected(true);
                } else {
                    selectedTab = null;
                    selecTabButton = null;
                }
            }
View Full Code Here

TOP

Related Classes of org.noos.xing.mydoggy.ToolWindowTab

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.