Package org.eclipse.jface.util

Examples of org.eclipse.jface.util.ListenerList


        /**
         * Constructs a new ItemsList.
         */
        ItemsList() {
            modelListeners = new ListenerList();
        }
View Full Code Here


        }
        this.menuItemImage = menuItemImage;
        this.menuItemText = menuItemText == null ? "" : menuItemText; //$NON-NLS-1$
        this.tooltipText = tooltipText == null ? "" : tooltipText; //$NON-NLS-1$

        listeners = new ListenerList();
    }
View Full Code Here

    /**
     * Initializes a <code>AbstractPolicyValueModifier</code> instance
     */
    public AbstractPolicyValueModifier() {
        listeners = new ListenerList();
    }
View Full Code Here

            throw new IllegalArgumentException("Cannot be null: factory."); //$NON-NLS-1$
        }
        this.duplicatesAllowed = duplicatesAllowed;
        this.factory = factory;
        this.listValidator = listValidator;
        listeners = new ListenerList();
        createControl(style, title, items);

        validatorTask = new ValidatorTaskExecutor();
        validatorTask.start();
    }
View Full Code Here

    public ListValueBuilder(Composite parent, boolean ordered,
                            SelectionDialog selectionDialog) {
        super(parent, SWT.NONE);
        this.ordered = ordered;
        this.selectionDialog = selectionDialog;
        this.listeners = new ListenerList();
        createControl();
        // create the list that will contain the items
        itemsList = new ItemsList();
        itemsList.addModifyListener(itemsListModifyListener);
        tableViewer.setInput(itemsList);
View Full Code Here

     * is associated with
     */
    public synchronized void addProjectDeviceRepositoryChangeListener(
            ProjectDeviceRepositoryChangeListener listener,
            IProject project) {
        ListenerList list = (ListenerList) listenerMap.get(project);
        if (list == null) {
            list = new ListenerList();
        }
        list.add(listener);
        listenerMap.put(project, list);
    }
View Full Code Here

     */
    public synchronized void removeProjectDeviceRepositoryChangeListener(
            ProjectDeviceRepositoryChangeListener listener,
            IProject project) {

        ListenerList listeners = (ListenerList) listenerMap.get(project);
        if (listeners != null) {
            listeners.remove(listener);
            if (listeners.size() == 0) {
                listenerMap.remove(project);
            }
        }
    }
View Full Code Here

     * Notify ProjectDeviceRepositoryChangeListeners that there has been
     * a change to a project device repository.
     * @param project the IProject whose device repository has changed
     */
    private synchronized void notifyChangeListeners(IProject project) {
        ListenerList list = (ListenerList) listenerMap.get(project);
        if (list != null) {
            Object listeners [] = list.getListeners();
            for (int i = 0; i < listeners.length; i++) {
                ((ProjectDeviceRepositoryChangeListener) listeners[i]).
                        changed();
            }
        }
View Full Code Here

        if (items == null || items.length == 0) {
            throw new IllegalArgumentException("Cannot be null nor empty: items.");
        }
        this.items = items;
        imageCache = new HashMap(items.length, 1);
        listeners = new ListenerList();
        // A load factor of 1 is specified to allow the HashMap to be filled to
        // its specified capacity, without having to resize. The default load
        // factor of 0.75 means that when the HashMap is 3/4 full, it will be
        // resized by rehashing to roughly double its size.
        dropDownItemHash = new HashMap(items.length, 1);
View Full Code Here

     * Test that the adding of selection changed listeners works as expected.
     */
    public void testAddSelectionChangedListener() throws Exception {
        // Add a null listener.
        manager.addSelectionChangedListener(null);
        ListenerList listeners = getSelectionChangedListenersList();
        assertNotNull(listeners);
        assertTrue("List should be empty", listeners.isEmpty());

        // Add a non-null listener.
        final ISelectionChangedListener listener =
                new ISelectionChangedListener() {
                    public void selectionChanged(SelectionChangedEvent event) {
                    }
                };

        manager.addSelectionChangedListener(listener);
        listeners = getSelectionChangedListenersList();
        assertNotNull(listeners);
        assertEquals("List size should match", 1, listeners.size());

        // Adding the same listener again shouldn't change the size.
        manager.addSelectionChangedListener(listener);
        listeners = getSelectionChangedListenersList();
        assertNotNull(listeners);
        assertEquals("List size should match", 1, listeners.size());
    }
View Full Code Here

TOP

Related Classes of org.eclipse.jface.util.ListenerList

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.