Java Code Examples for org.eclipse.jface.util.IPropertyChangeListener#propertyChange()

The following examples show how to use org.eclipse.jface.util.IPropertyChangeListener#propertyChange() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ColorField.java    From goclipse with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public void setColorValue(RGB newColor) {
	RGB oldValue = getColorValue();
	super.setColorValue(newColor);
	
    final Object[] finalListeners = getListeners();
    if (finalListeners.length > 0) {
        PropertyChangeEvent pEvent = new PropertyChangeEvent(this, PROP_COLORCHANGE, oldValue, newColor);
        
        for (Object object : finalListeners) {
            IPropertyChangeListener listener = (IPropertyChangeListener) object;
            listener.propertyChange(pEvent);
		}
    }

}
 
Example 2
Source File: CppcheclipsePlugin.java    From cppcheclipse with Apache License 2.0 5 votes vote down vote up
public void propertyChange(PropertyChangeEvent event) {
	if (IPreferenceConstants.P_BINARY_PATH.equals(event
			.getProperty())) {
		for (IPropertyChangeListener binaryPathChangeListener : binaryPathChangeListeners) {
			binaryPathChangeListener.propertyChange(event);
		}
	}
}
 
Example 3
Source File: BoxSettingsImpl.java    From gama with GNU General Public License v3.0 5 votes vote down vote up
protected void notifyChange(final String propertyName, final Object oldValue, final Object newValue) {
	if (listeners != null) {
		final PropertyChangeEvent e = new PropertyChangeEvent(this, propertyName, oldValue, newValue);
		for (final IPropertyChangeListener listener : listeners) {
			listener.propertyChange(e);
		}
	}
}
 
Example 4
Source File: DialogArea.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
protected void firePropertyChangeChange(String property, Object oldValue, Object newValue) {
	PropertyChangeEvent event = new PropertyChangeEvent(this, property, oldValue, newValue);
	for (Iterator iter = listeners.iterator(); iter.hasNext();) {
		IPropertyChangeListener listener = (IPropertyChangeListener) iter.next();
		listener.propertyChange(event);
	}
}
 
Example 5
Source File: PreferencesAdapter.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
public void firePropertyChangeEvent(String name, Object oldValue, Object newValue) {
	if (!fSilent) {
		final PropertyChangeEvent event= new PropertyChangeEvent(this, name, oldValue, newValue);
		Object[] listeners= fListeners.getListeners();
		for (int i= 0; i < listeners.length; i++) {
			final IPropertyChangeListener listener= (IPropertyChangeListener)listeners[i];
			Runnable runnable= new Runnable() {
				public void run() {
					listener.propertyChange(event);
				}
			};

			if (Display.getCurrent() != null)
				runnable.run();
			else {
				// Post runnable into UI thread
				Shell shell= JavaPlugin.getActiveWorkbenchShell();
				Display display;
				if (shell != null)
					display= shell.getDisplay();
				else
					display= Display.getDefault();
				display.asyncExec(runnable);
			}
		}
	}
}
 
Example 6
Source File: SREConfigurationBlock.java    From sarl with Apache License 2.0 5 votes vote down vote up
private void firePropertyChange() {
	if (this.notify) {
		final PropertyChangeEvent event = new PropertyChangeEvent(this,
				PROPERTY_SRE_CONFIGURATION, null,
				getSelectedSRE());
		final Object[] listeners = this.listeners.getListeners();
		for (int i = 0; i < listeners.length; i++) {
			final IPropertyChangeListener listener = (IPropertyChangeListener) listeners[i];
			listener.propertyChange(event);
		}
	}
}
 
Example 7
Source File: SpinnerYear.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Fire the event when the year value change
 * 
 * @param e
 */
public void firePropertyListener( PropertyChangeEvent e )
{
	int size = listenerList.size( );
	for ( int i = 0; i < size; i++ )
	{
		IPropertyChangeListener listener = (IPropertyChangeListener) listenerList.get( i );
		listener.propertyChange( e );
	}
}
 
Example 8
Source File: SpinnerTime.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Fire the event when the year value change
 * 
 * @param e
 */
public void firePropertyListener( PropertyChangeEvent e )
{
	int size = listenerList.size( );
	for ( int i = 0; i < size; i++ )
	{
		IPropertyChangeListener listener = (IPropertyChangeListener) listenerList.get( i );
		listener.propertyChange( e );
	}
}
 
Example 9
Source File: SpinnerTime.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
public void firePropertyListener( PropertyChangeEvent e )
{
	int size = listenerList.size( );
	for ( int i = 0; i < size; i++ )
	{
		IPropertyChangeListener listener = (IPropertyChangeListener) listenerList.get( i );
		listener.propertyChange( e );
	}
}
 
Example 10
Source File: SpinnerTable.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Fire the event when the year value change
 * 
 * @param e
 */
public void firePropertyListener( PropertyChangeEvent e )
{
	int size = listenerList.size( );
	for ( int i = 0; i < size; i++ )
	{
		IPropertyChangeListener listener = (IPropertyChangeListener) listenerList.get( i );
		listener.propertyChange( e );
	}
}
 
Example 11
Source File: PrefStoreListener.java    From goclipse with Eclipse Public License 1.0 5 votes vote down vote up
public static void addBoundPrefStoreListener(IPreferenceStore preferenceStore, List<IDisposable> owned,
		IPropertyChangeListener listener) {
	PrefStoreListener boundListener = new PrefStoreListener(preferenceStore) {
		@Override
		public void propertyChange(PropertyChangeEvent event) {
			listener.propertyChange(event);
		}
	};
	
	if(owned != null) {
		owned.add(boundListener);
	}
}
 
Example 12
Source File: EclipseMemoryPreferenceStore.java    From saros with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void firePropertyChangeEvent(String name, Object oldValue, Object newValue) {
  for (IPropertyChangeListener listener : listeners)
    listener.propertyChange(new PropertyChangeEvent(this, name, oldValue, newValue));
}
 
Example 13
Source File: SettingsPreferenceStore.java    From elexis-3-core with Eclipse Public License 1.0 4 votes vote down vote up
public void firePropertyChangeEvent(String name, Object oldValue, Object newValue){
	for (IPropertyChangeListener l : listeners) {
		l.propertyChange(new PropertyChangeEvent(this, name, oldValue, newValue));
	}
}