Package org.noos.xing.mydoggy

Examples of org.noos.xing.mydoggy.Content


        public void mouseClicked(MouseEvent e) {
            if (mouseOverTab >= 0 && mouseOverTab < getTabCount()) {
                if (mouseOverTab == mouseOverTabWhenPressed && !selectionOnPressed)
                    return;

                Content content = getContentAt(mouseOverTab);

                if (SwingUtilities.isLeftMouseButton(e)) {
                    if (isDetachFired(content.getContentUI(), e.getPoint())) {
                        fireDetachTabEvent(content);
                        return;
                    }

                    if (isCloseFired(content.getContentUI(), e.getPoint())) {
                        fireCloseTabEvent(content);
                        return;
                    }

                    if (e.getClickCount() == 2)
                        content.setMaximized(!content.isMaximized());
                } else if (SwingUtilities.isRightMouseButton(e))
                        showPopupMenu(e);
            } else if (SwingUtilities.isRightMouseButton(e)) {
                JPopupMenu popupMenu = getComponentPopupMenu();
                if (popupMenu != null)
View Full Code Here


            }
            return JTabbedContentPane.this;
        }

        protected void showPopupMenu(final MouseEvent mouseEvent) {
            final Content contentAt = getContentAt(mouseOverTab);
            JPopupMenu popupMenu = contentAt.getPopupMenu();
            if (popupMenu == null)
                popupMenu = getComponentPopupMenu();

            if (popupMenu == null) {
                // Init stdPopupMenu
                stdPopupMenu = new JPopupMenu("Content Page Popup");
                stdPopupMenu.add(new JMenuItem(new AbstractAction(resourceManager.getString("@@tabbed.page.close")) {
                    public void actionPerformed(ActionEvent e) {
                        JTabbedContentPane.this.fireCloseTabEvent(contentAt);
                    }
                })).setEnabled(contentAt.getContentUI().isCloseable());

                stdPopupMenu.add(new JMenuItem(new AbstractAction(resourceManager.getString("@@tabbed.page.closeAll")) {
                    public void actionPerformed(ActionEvent e) {
                        for (Content content : toolWindowManager.getContentManager().getContents()) {
                            if (content.getContentUI().isCloseable())
                                JTabbedContentPane.this.fireCloseTabEvent(content);
                        }
                    }
                }));

                stdPopupMenu.add(new JMenuItem(new AbstractAction(resourceManager.getString("@@tabbed.page.closeAllButThis")) {
                    public void actionPerformed(ActionEvent e) {
                        for (Content content : toolWindowManager.getContentManager().getContents()) {
                            if (content != contentAt && content.getContentUI().isCloseable())
                                JTabbedContentPane.this.fireCloseTabEvent(content);
                        }
                    }
                }));
                stdPopupMenu.addSeparator();
                stdPopupMenu.add(new JMenuItem(new AbstractAction(resourceManager.getString("@@tabbed.page.detach")) {
                    public void actionPerformed(ActionEvent e) {
                        JTabbedContentPane.this.fireDetachTabEvent(contentAt);
                    }
                })).setEnabled(contentAt.getContentUI().isDetachable());

                MaximizeAction maximizeAction = new MaximizeAction(contentAt);
                stdPopupMenu.add(maximizeAction);
                maximizeAction.putValue(Action.NAME, contentAt.isMaximized() || isAContentMaximized() ?
                                                     resourceManager.getString("@@tabbed.page.restore") :
                                                     resourceManager.getString("@@tabbed.page.maximize")
                );
                popupMenu = stdPopupMenu;
            }
View Full Code Here

        return result;
    }

    public boolean removeContent(int index) {
        Content content = contents.get(index);
        return removeContent(content);
    }
View Full Code Here

        contentManagerUI.setShowAlwaysTab(true);
        contentManagerUI.setTabLayout(TabLayout.WRAP);

        for (int index = 0; index < 3; index++) {
            String contentId = "Content_" + index;
            Content content = contentManager.addContent(contentId, contentId, null, new JPanel());
            content.getContentUI().setDetachable(true);
        }
    }
View Full Code Here

        ContentManager contentManager = toolWindowManager.getContentManager();

        TestCMListener listener = new TestCMListener();
        contentManager.addContentManagerListener(listener);

        Content content = contentManager.addContent("key", "content", null, new JButton("Hello World!!!"));

        assertTrue(listener.isContentAdded());
        assertNotNull(listener.getLastEvent());
        assertEquals(ContentManagerEvent.ActionId.CONTENT_ADDED, listener.getLastEvent().getId());
        assertEquals(content, listener.getLastEvent().getContent());
View Full Code Here

        ContentManager contentManager = toolWindowManager.getContentManager();

        TestCMListener listener = new TestCMListener();
        contentManager.addContentManagerListener(listener);

        Content content = contentManager.addContent("key", "content", null, new JButton("Hello World!!!"));
        assertTrue(contentManager.removeContent(content));

        assertTrue(listener.isContentRemoved());
        assertNotNull(listener.getLastEvent());
        assertEquals(ContentManagerEvent.ActionId.CONTENT_REMOVED, listener.getLastEvent().getId());
View Full Code Here

        ContentManager contentManager = toolWindowManager.getContentManager();

        TestCMListener listener = new TestCMListener();
        contentManager.addContentManagerListener(listener);

        Content content = contentManager.addContent("key", "content", null, new JButton("Hello World!!!"));

        assertTrue(listener.isContentAdded());
        assertNotNull(listener.getLastEvent());
        assertEquals(ContentManagerEvent.ActionId.CONTENT_ADDED, listener.getLastEvent().getId());
        assertEquals(content, listener.getLastEvent().getContent());
View Full Code Here

        ContentManager contentManager = toolWindowManager.getContentManager();

        TestCMListener listener = new TestCMListener();
        contentManager.addContentManagerListener(listener);

        Content content = contentManager.addContent("key", "content", null, new JButton("Hello World!!!"));
        assertTrue(contentManager.removeContent(content));

        assertTrue(listener.isContentRemoved());
        assertNotNull(listener.getLastEvent());
        assertEquals(ContentManagerEvent.ActionId.CONTENT_REMOVED, listener.getLastEvent().getId());
View Full Code Here

        assertNotNull(toolWindowManager.getContentManager());
    }

    public void testAddContentOne() {
        ContentManager contentManager = toolWindowManager.getContentManager();
        Content content = contentManager.addContent("key", "title", null, new JButton("Hello World!!!"));

        assertNotNull(content);
        assertEquals(contentManager.getContentCount(), 1);

        content = contentManager.getContent(0);

        assertEquals(content.getTitle(), "title");
        assertEquals(content.getIcon(), null);
        assertEquals(content.getToolTipText(), null);
        assertTrue(content.getComponent() instanceof JButton);

        content = contentManager.getContent("key");

        assertEquals(content.getTitle(), "title");
        assertEquals(content.getIcon(), null);
        assertEquals(content.getToolTipText(), null);
        assertTrue(content.getComponent() instanceof JButton);
    }
View Full Code Here

        assertNotNull(toolWindowManager.getContentManager());
    }

    public void testAddContentOne() {
        ContentManager contentManager = toolWindowManager.getContentManager();
        Content content = contentManager.addContent("key", "title", null, new JButton("Hello World!!!"));

        assertNotNull(content);
        assertEquals(contentManager.getContentCount(), 1);

        content = contentManager.getContent(0);

        assertEquals(content.getTitle(), "title");
        assertEquals(content.getIcon(), null);
        assertEquals(content.getToolTipText(), null);
        assertTrue(content.getComponent() instanceof JButton);

        content = contentManager.getContent("key");

        assertEquals(content.getTitle(), "title");
        assertEquals(content.getIcon(), null);
        assertEquals(content.getToolTipText(), null);
        assertTrue(content.getComponent() instanceof JButton);
    }
View Full Code Here

TOP

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

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.