Package org.noos.xing.mydoggy

Examples of org.noos.xing.mydoggy.Content


        } else {
            constraint = new MultiSplitConstraint(AggregationPosition.DEFAULT);
        }

        // Create and register a new content to the mydoggy layout manager
        Content c = contentManager.addContent(
                pageComponent.getId(),
                pageComponent.getDisplayName(), // tabName
                pageComponent.getIcon(),
                pageComponent.getControl(),
                pageComponent.getDisplayName(), // toolTip
                constraint);

        Assert.notNull(c);
        Assert.isTrue(c.getId().equals(pageComponent.getId()));
        contentAndPageComponentById.put(pageComponent.getId(),
                new DoggyEntry<Content, PageComponent>(c, pageComponent));

        // trigger the createControl method of the PageComponent, so if a
        // PageComponentListener is added
View Full Code Here


    @Override
    public void setActiveComponent(PageComponent pageComponent) {
        if (pageComponent != null) {
            // really necessary?
            Content c = getContent(pageComponent.getId());
            if (c != null) {
                c.ensureVisible();
            }
            setActive(pageComponent.getId());
        }
        super.setActiveComponent(pageComponent);
    }
View Full Code Here

     * @return true if it was successful.
     */
    private boolean setActive(final String id) {
        Assert.isTrue(SwingUtilities.isEventDispatchThread());

        Content c = getContent(id);
        if (c != null) {
            c.setSelected(true);
            return true;
        }
        return false;
    }
View Full Code Here

     */
    private class MyDoggyContentListener implements ContentManagerUIListener {

        @Override
        public boolean contentUIRemoving(ContentManagerUIEvent cmEvent) {
            Content content = cmEvent.getContentUI().getContent();
            Assert.notNull(content);
            PageComponent pc = getPageComponent(content.getId());
            Assert.notNull(pc);
            close(pc);

            // let mydoggy remove the page ! (don't no for sure if this is the reason of the NPE in mydoggy if we return close(pc))
            return false;
View Full Code Here

    protected void initContentManager() {
         JTree treeContent = new JTree();

        ContentManager contentManager = toolWindowManager.getContentManager();
        Content content = contentManager.addContent("Tree Key",
                                                    "Tree Title",
                                                    null,      // An icon
                                                    treeContent);
        content.setToolTipText("Tree tip");

        setupContentManagerUI();
    }
View Full Code Here

        actionPerformed(null);
    }

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

        return super.getTitleAt(index);
    }

    public Icon getIconAt(int index) {
        if (getSelectedIndex() == index) {
            Content content = contentMap.get(index);
            if (content == null)
                return super.getIconAt(index);

            ContentUI contentUI = content.getContentUI();
            if (contentUI == null)
                return super.getIconAt(index);

            titleIcon.setText(super.getTitleAt(index));
            titleIcon.setUnderlinedIndex(
                    SwingUtil.findDisplayedMnemonicIndex(super.getTitleAt(index),
                                                         getContentAt(index).getMnemonic())
            );

            tabIconTitle.setLeftIcon(super.getIconAt(index));

            minCloseDetachIcon.setLeftVisible(contentUI.isMinimizable());
            closeDetachIcon.setLeftVisible(contentUI.isDetachable());
            closeDetachIcon.setRightVisible(contentUI.isCloseable());

            ((ExAggregateIcon) selectedTabIcon).setIndex(index);

            return selectedTabIcon;
        } else if (flashingContents.containsKey(getContentAt(index))) {
            Content content = getContentAt(index);
            Object o = flashingContents.get(content);
            if (o == null) {
                TextIcon textIcon = new TextIcon(this, super.getTitleAt(index), TextIcon.ROTATE_NONE);
                textIcon.setUnderlinedIndex(
                        SwingUtil.findDisplayedMnemonicIndex(super.getTitleAt(index),
View Full Code Here

        }
        return super.getIconAt(index);
    }

    public void removeTabAt(int index) {
        Content content = getContentAt(index);
        if (content == null)
            throw new IllegalArgumentException("Invalid index location.");

        content.removePropertyChangeListener(this);
        super.removeTabAt(index);
        contentMap.remove(index);

        Integer[] keys = contentMap.keySet().toArray(new Integer[contentMap.size()]);
        Arrays.sort(keys);
View Full Code Here

            return;
        }

        // Remove content tab
        Component cmp = getComponentAt(prev);
        Content content = getContentAt(prev);
        if (content == null)
            throw new IllegalArgumentException("Invalid index location.");
        content.removePropertyChangeListener(this);
        super.removeTabAt(prev);
        contentMap.remove(prev);
        Integer[] keys = contentMap.keySet().toArray(new Integer[contentMap.size()]);
        Arrays.sort(keys);
        for (Integer key : keys) {
View Full Code Here

        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 (isMinimizedFired(content.getContentUI(), e.getPoint())) {
                        content.setMinimized(!content.isMinimized());
                        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

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.