Package org.noos.xing.mydoggy.plaf.ui

Examples of org.noos.xing.mydoggy.plaf.ui.ToolWindowDescriptor


                                String title, Icon icon, Component component,
                                ResourceBundle resourceBundle) {
        this.internalListenerList = new EventListenerList();
        this.listenerList = new EventListenerList();

        this.descriptor = new ToolWindowDescriptor(manager, this);
        this.resourceBundle = resourceBundle;
        this.toolWindowTabs = new ArrayList<ToolWindowTab>();

        rootTab = addTabInternal(title, null, component, null, true);
View Full Code Here


                      String title, Icon icon, Component component,
                      ResourceBundle resourceBundle) {
        this.internalListenerList = new EventListenerList();
        this.listenerList = new EventListenerList();

        this.descriptor = new ToolWindowDescriptor(manager, this, anchestor, component);
        this.resourceBoundle = resourceBundle;

        this.id = id;
        this.index = index;
        this.anchor = anchor;
View Full Code Here

        return toolWindow;
    }

    public void unregisterToolWindow(String id) {
        final ToolWindowDescriptor toolWindowDescriptor = tools.get(id);

        if (toolWindowDescriptor != null) {
            removeIfDockableDelegator(toolWindowDescriptor.getToolWindow());
            toolWindowDescriptor.unregister();
            toolWindowDescriptor.getToolWindow().setAvailable(false);

            tools.remove(toolWindowDescriptor.getToolWindow().getId());

            // Remove aliases
            for (Iterator<ToolWindow> iterator = aliases.values().iterator(); iterator.hasNext();) {
                ToolWindow toolWindow = iterator.next();
                if (toolWindow == toolWindowDescriptor.getToolWindow())
                    iterator.remove();
            }

            fireUnregisteredToolEvent(toolWindowDescriptor.getToolWindow());
        } else
            throw new IllegalArgumentException("Doesn't exist a tool window with passed id. [id : " + id + "]");
    }
View Full Code Here

            throw new IllegalArgumentException("Doesn't exist a tool window with passed id. [id : " + id + "]");
    }

    public void unregisterAllToolWindow() {
        for (Iterator<ToolWindowDescriptor> it = tools.values().iterator(); it.hasNext();) {
            ToolWindowDescriptor toolWindowDescriptor = it.next();

            removeIfDockableDelegator(toolWindowDescriptor.getToolWindow());
            toolWindowDescriptor.unregister();
            toolWindowDescriptor.getToolWindow().setAvailable(false);

            fireUnregisteredToolEvent(toolWindowDescriptor.getToolWindow());
            it.remove();
        }
        aliases.clear();
    }
View Full Code Here

    public ToolWindow getToolWindow(Object key) {
        if (key == null)
            return null;
       
        ToolWindowDescriptor descriptor = tools.get(key);

        if (descriptor == null) {
            return aliases.get(key);
        } else
            return descriptor.getToolWindow();
    }
View Full Code Here

    }

    public synchronized void propertyChange(final PropertyChangeEvent evt) {
        Object source = evt.getSource();
        if (source instanceof ToolWindowDescriptor) {
            ToolWindowDescriptor descriptor = (ToolWindowDescriptor) source;
            if (!tools.containsValue(descriptor)) {
                new RuntimeException("Manager doesn't contain that ToolWindow. [id : " + descriptor.getToolWindow().getId() + "]").printStackTrace();
                return;
            }
        } else if (!(source instanceof MyDoggyToolWindowBar) &&
                   !(source instanceof MyDoggyToolWindowManagerDescriptor) &&
                   !(source instanceof MyDoggyToolWindowManager)) {
View Full Code Here

                    tool.getToolWindowContainer().propertyChange(evt);
            }
        });
        propertyChangeSupport.addPropertyChangeListener("anchor.index", new PropertyChangeListener() {
            public void propertyChange(PropertyChangeEvent evt) {
                ToolWindowDescriptor descriptor = (ToolWindowDescriptor) evt.getSource();

                if (descriptor.getToolWindow().getType() == ToolWindowType.DOCKED)
                    getBar(descriptor.getToolWindow().getAnchor()).propertyChange(evt);
            }
        });
        propertyChangeSupport.addPropertyChangeListener("parentComponent.closed", new AnchorClosedChangeListener());
        propertyChangeSupport.addPropertyChangeListener("resourceManager", new PropertyChangeListener() {
            public void propertyChange(PropertyChangeEvent evt) {
View Full Code Here

    }


    protected class AvailablePropertyChangeListener implements PropertyChangeListener {
        public void propertyChange(PropertyChangeEvent evt) {
            ToolWindowDescriptor descriptor = (ToolWindowDescriptor) evt.getSource();

            ToolWindowAnchor target = descriptor.getToolWindow().getAnchor();
            // Notify specific bar
            getBar(target).propertyChange(evt);

            // Syncronize bars panel
            syncPanel(target);
View Full Code Here

    protected class VisiblePropertyChangeListener implements PropertyChangeListener {
        boolean showingGroupValueAdj = false;

        public void propertyChange(PropertyChangeEvent evt) {
            ToolWindowDescriptor descriptor = (ToolWindowDescriptor) evt.getSource();

            // Fire "visible.before" to all bars
            PropertyChangeEvent event = new PropertyChangeEvent(evt.getSource(), "visible.before",
                                                                evt.getOldValue(), evt.getNewValue());
            for (MyDoggyToolWindowBar bar : bars)
                bar.propertyChange(event);

            // Fire "visible" to specific bar
            getBar(descriptor.getToolWindow().getAnchor()).propertyChange(evt);

            // Syncronize bars panel
            syncPanel(descriptor.getToolWindow().getAnchor());

            // Support for implicit group...
            synchronized (sync) {
                if ((showingGroup == null || showingGroup == getToolWindowGroup()) && Boolean.TRUE.equals(evt.getNewValue()) && !showingGroupValueAdj) {
                    showingGroupValueAdj = true;
                    try {
                        for (ToolWindowGroup group : getToolWindowGroups()) {
                            if (group.isImplicit() && group.containesToolWindow(descriptor.getToolWindow())) {
                                for (ToolWindow tool : group.getToolsWindow()) {
                                    if (tool != descriptor.getToolWindow())
                                        tool.aggregate();
                                }
                                break;
                            }
                        }
View Full Code Here

    }

    protected class ActivePropertyChangeListener implements PropertyChangeListener {

        public synchronized void propertyChange(PropertyChangeEvent evt) {
            ToolWindowDescriptor descriptor = (ToolWindowDescriptor) evt.getSource();

            // Fire "active.before" for all bars
            PropertyChangeEvent event = new PropertyChangeEvent(evt.getSource(), "active.before",
                                                                evt.getOldValue(), evt.getNewValue());
            for (MyDoggyToolWindowBar bar : bars)
                bar.propertyChange(event);

            // Fire "active" for specific bar
            getBar(descriptor.getToolWindow().getAnchor()).propertyChange(evt);

            if (Boolean.FALSE.equals(evt.getNewValue())) {
                activeToolWindowId = null;

                if (lastFocusOwner != null) {
                    boolean shouldRequest = true;
                    for (MyDoggyToolWindowBar bar : bars) {
                        if (bar.valueAdjusting && getBar(descriptor.getToolWindow().getAnchor()) == bar) {
                            shouldRequest = false;
                            break;
                        }
                    }
                    if (shouldRequest)
                        SwingUtil.requestFocus(lastFocusOwner);
                }
            } else
                activeToolWindowId = descriptor.getToolWindow().getId();
        }
View Full Code Here

TOP

Related Classes of org.noos.xing.mydoggy.plaf.ui.ToolWindowDescriptor

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.