Examples of ListenerList


Examples of org.eclipse.jface.util.ListenerList

            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

Examples of org.eclipse.jface.util.ListenerList

    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

Examples of org.eclipse.jface.util.ListenerList

     * 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

Examples of org.eclipse.jface.util.ListenerList

     */
    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

Examples of org.eclipse.jface.util.ListenerList

     * 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

Examples of org.eclipse.jface.util.ListenerList

        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

Examples of org.eclipse.jface.util.ListenerList

     * 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

Examples of org.eclipse.jface.util.ListenerList

                    public void selectionChanged(SelectionChangedEvent event) {
                    }
                };

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


        manager.removeSelectionChangedListener(listener);
        listeners = getSelectionChangedListenersList();
        assertNotNull(listeners);
        assertTrue("List should be empty", listeners.isEmpty());

        // Removing the same listener again shouldn't change the size or
        // cause any exceptions.
        manager.removeSelectionChangedListener(listener);
        listeners = getSelectionChangedListenersList();
        assertNotNull(listeners);
        assertTrue("List should be empty", listeners.isEmpty());
    }
View Full Code Here

Examples of org.eclipse.jface.util.ListenerList

        super(parent, SWT.NONE);
        this.duplicatesAllowed = duplicatesAllowed;
        this.parser = (parser == null) ? DEFAULT_PARSER : parser;
        createControl(style, title, items, editable, factory);

        listeners = new ListenerList();

        validatorTask = new ValidatorTaskExecutor();
        validatorTask.start();

        updateButtons();
View Full Code Here

Examples of org.eclipse.jface.util.ListenerList

     * @param parent the parent Composite
     * @param style the style for the parent
     */
    public FontSelector(Composite parent, int style) {
        super(parent, style);
        listeners = new ListenerList();
        createSelector();
        initAccessible();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.