Package org.noos.xing.mydoggy

Examples of org.noos.xing.mydoggy.Content


                String generatedTitle =
                        String.valueOf(System.identityHashCode(new Object()));
                JLabel component = new JLabel(generatedTitle);
                component.setSize(200, 200);
                component.setPreferredSize(new Dimension(200, 200));
                Content addContent = toolWindowManager.getContentManager().addContent(generatedTitle, "Title : " + generatedTitle, null, component);
                addContent.setSelected(true);

            }
        });
        contentPane.add(a, BorderLayout.NORTH);
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

        JPopupMenu popupMenu = new JPopupMenu("CPM");
        popupMenu.add("1");
        popupMenu.add("2");
        popupMenu.add("3");

        Content content = contentManager.addContent("Hello", "Hello", null, new JButton("Hello"));
//        content.setPopupMenu(popupMenu);

        contentManager.setPopupMenu(popupMenu);
    }
View Full Code Here

    public PreviousContentAction(ToolWindowManager toolWindowManager) {
        this.toolWindowManager = toolWindowManager;
    }

    public void actionPerformed(ActionEvent e) {
        Content content = toolWindowManager.getContentManager().getPreviousContent();
        if (content != null)
            content.setSelected(true);
    }
View Full Code Here

        internalFrame.addPropertyChangeListener(JInternalFrame.IS_SELECTED_PROPERTY, new PropertyChangeListener() {
            public void propertyChange(PropertyChangeEvent evt) {
                if (!contentManagerUI.valueAdjusting && !contentManagerUI.contentValueAdjusting) {
                    ContentUI contentUI = content.getContentUI();
                    if (contentUI != null) {
                        Content content = contentUI.getContent();
                        if (content == null)
                            return;

                        boolean value = (Boolean) evt.getNewValue();
                        if (value) {
                            if (contentManagerUI.lastSelected != null) {
                                if (contentManagerUI.lastSelected.isDetached())
                                    contentManagerUI.lastSelected.setSelected(false);
                            }
                            content.setSelected(true);
                            contentManagerUI.lastSelected = content;
                        } else
                            content.setSelected(false);
                    }
                }
            }
        });
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);
    }
View Full Code Here

    }

    public void actionPerformed(ActionEvent e) {
        ContentManager contentManager = toolWindowManager.getContentManager();
        if (contentManager.getContent(contentId) == null) {
            Content content = contentManager.addContent(contentId,
                                      title,
                                      icon,
                                      component,
                                      tooltip);
            if (mnemonic != -1)
                content.setMnemonic(mnemonic);
            content.setSelected(true);
        }
    }
View Full Code Here

    public NextContentAction(ToolWindowManager toolWindowManager) {
        this.toolWindowManager = toolWindowManager;
    }

    public void actionPerformed(ActionEvent e) {
        Content content = toolWindowManager.getContentManager().getNextContent();
        if (content != null)
            content.setSelected(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.