Package org.noos.xing.mydoggy

Examples of org.noos.xing.mydoggy.Content


            }

            if (mouseOverTab == -1) {
                currentToolTip = null;
            } else {
                Content content = getContentAt(mouseOverTab);
                if (content == null)
                    return;

                ContentUI contentUI = content.getContentUI();

                Point point = e.getPoint();
                if (isMinimizedFired(contentUI, point))
                    currentToolTip = SwingUtil.getString("@@tabbed.page.minimize");
                else if (isMaximizeFired(contentUI, point))
View Full Code Here


            }
            return TabbedContentPane.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");

                if (contentAt.getContentUI().isCloseable()) {
                    stdPopupMenu.add(new JMenuItem(new AbstractAction(SwingUtil.getString("@@tabbed.page.close")) {
                        public void actionPerformed(ActionEvent e) {
                            TabbedContentPane.this.fireCloseTabEvent(contentAt);
                        }
                    }));
                }

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

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

                boolean restore = false;
                if (contentAt.getContentUI().isDetachable() && showDetach) {
                    stdPopupMenu.addSeparator();
                    stdPopupMenu.add(new JMenuItem(new AbstractAction(SwingUtil.getString("@@tabbed.page.detach")) {
                        public void actionPerformed(ActionEvent e) {
                            TabbedContentPane.this.fireDetachTabEvent(contentAt);
                        }
                    }));
                }


                if (contentAt.getContentUI().isMaximizable() && showMaximize) {
                    MaximizeAction maximizeAction = new MaximizeAction(contentAt);
                    restore = contentAt.isMaximized() || isAContentMaximized();
                    maximizeAction.putValue(Action.NAME, restore ?
                            SwingUtil.getString("@@tabbed.page.restore") :
                            SwingUtil.getString("@@tabbed.page.maximize")
                    );

                    stdPopupMenu.add(maximizeAction);
                }

                if (!restore && contentAt.getContentUI().isMinimizable() && showMinimize) {
                    stdPopupMenu.add(new MinimizeAction(contentAt));
                }

                popupMenu = stdPopupMenu;
            }
View Full Code Here

        protected void dropContent(Transferable transferable, DropTargetDropEvent dtde) {
            ((ToolWindowBarDropTarget) dtde.getDropTargetContext().getDropTarget()).hidePosition(true);

            try {
                String contentId = (String) transferable.getTransferData(MyDoggyTransferable.CONTENT_ID_DF);
                Content content = manager.getContentManager().getContent(contentId);
                if (content == null)
                    return;

                dtde.acceptDrop(DnDConstants.ACTION_MOVE);
                // Chech if it was a tab
                if (content.getDockableDelegator() != null) {
                    if (content.getDockableDelegator() instanceof ToolWindow) {
                        ToolWindow toolWindow = (ToolWindow) content.getDockableDelegator();

                        manager.getContentManager().removeContent(content);

                        toolWindow.setAnchor(anchor, index);
                        toolWindow.setActive(true);
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

        assertTrue(content.getComponent() instanceof JButton);
    }

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

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

        content = contentManager.getContent(0);

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

        assertTrue(content.getComponent() instanceof JButton);
    }

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

        assertNotNull(contentManager.getAliases(content));
        assertEquals(0, contentManager.getAliases(content).length);

        contentManager.addAlias(content, ContentManager.class);

        assertEquals(1, contentManager.getAliases(content).length);

        Content contentByAlias = contentManager.getContent(ContentManager.class);
        assertEquals(content, contentByAlias);

        contentManager.removeAlias(ContentManager.class);

        contentByAlias = contentManager.getContent(ContentManager.class);
View Full Code Here


    public void test1() {
        ContentManager contentManager = toolWindowManager.getContentManager();

        Content ctn1 = contentManager.addContent("ctn1", "ctn1", null, new JButton("ctn1"));
        PropertyChangeListenerTracer ctn1Tracer = new PropertyChangeListenerTracer();       
        ctn1.addPropertyChangeListener(ctn1Tracer);

        Content ctn2 = contentManager.addContent("ctn2", "ctn2", null, new JButton("ctn2"));
        PropertyChangeListenerTracer ctn2Tracer = new PropertyChangeListenerTracer();
        ctn2.addPropertyChangeListener(ctn2Tracer);

        Content ctn3 = contentManager.addContent("ctn3", "ctn3", null, new JButton("ctn3"));
        PropertyChangeListenerTracer ctn3Tracer = new PropertyChangeListenerTracer();
        ctn3.addPropertyChangeListener(ctn3Tracer);

        contentManager.removeContent(ctn1);
        System.out.printf("dd");
    }
View Full Code Here


        for (int i = 0; i < 18; i++) {
            JPanel pane = new JPanel();
            //  pane.setPreferredSize(new Dimension(400,400));
            Content cont = contentManager.addContent("content" + i, "content" + i,
                                                     null, pane);
        }

        return this.toolW;
    }
View Full Code Here

        ContentManager contentManager = toolWindowManager.getContentManager();

        for (int i = 0; i < 8; i++) {
            JPanel pane = new JPanel();
            //  pane.setPreferredSize(new Dimension(400,400));
            Content cont = contentManager.addContent("content" + i, "content" + i, null, pane);
        }


        MyDoggyMultiSplitContentManagerUI contentUI = new MyDoggyMultiSplitContentManagerUI();
        this.toolWindowManager.getContentManager().setContentManagerUI(contentUI);
View Full Code Here

                ((ToolWindowBarDropTarget) dtde.getDropTargetContext().getDropTarget()).hidePosition(true);

                try {
                    String contentId = (String) transferable.getTransferData(MyDoggyTransferable.CONTENT_ID_DF);
                    Content content = manager.getContentManager().getContent(contentId);
                    if (content == null)
                        return;

                    dtde.acceptDrop(DnDConstants.ACTION_MOVE);
                    // Chech if it was a tab
                    if (content.getDockableDelegator() != null) {
                        if (content.getDockableDelegator() instanceof ToolWindow) {
                            ToolWindow toolWindow = (ToolWindow) content.getDockableDelegator();

                            manager.getContentManager().removeContent(content);

                            toolWindow.setAnchor(anchor, index);
                            toolWindow.setActive(true);
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.