Java Code Examples for org.eclipse.jface.util.PropertyChangeEvent#getSource()

The following examples show how to use org.eclipse.jface.util.PropertyChangeEvent#getSource() . 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: GhidraScriptEditorPreferencePage.java    From ghidra with Apache License 2.0 6 votes vote down vote up
@Override
public void propertyChange(PropertyChangeEvent event) {
	super.propertyChange(event);
	if (event.getProperty().equals(FieldEditor.VALUE)) {
		checkState();
	}
	if (event.getSource() == enabledField) {
		if (previousEnabledString == null) {
			previousEnabledString = event.getOldValue().toString();
		}
		currentEnabledString = event.getNewValue().toString();
	}
	else if (event.getSource() == portField) {
		if (previousPortString == null) {
			previousPortString = event.getOldValue().toString();
		}
		currentPortString = event.getNewValue().toString();
	}
}
 
Example 2
Source File: FindingsSettings.java    From elexis-3-core with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public void propertyChange(PropertyChangeEvent event){
	super.propertyChange(event);
	if (event != null) {
		if (event.getSource() == diagStructFieldEditor) {
			diagPropertyChange(event);
		}
		else if (event.getSource() == persAnamneseStructFieldEditor) {
			persAnamnesePropertyChange(event);
		}
		else if (event.getSource() == riskFactorStructFieldEditor) {
			riskFactorPropertyChange(event);
		}
		else if (event.getSource() == famAnamneseStructFieldEditor) {
			famAnamnesePropertyChange(event);
		}
		else if (event.getSource() == allergyIntoleranceStructFieldEditor) {
			allergyIntolerancePropertyChange(event);
		}
	}
}
 
Example 3
Source File: MedicationSettings.java    From elexis-3-core with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public void propertyChange(PropertyChangeEvent event){
	super.propertyChange(event);
	
	// make sure custom sorting is disabled
	if (event.getSource() == sortingFieldEditor) {
		MedicationView view =
			(MedicationView) PlatformUI.getWorkbench().getActiveWorkbenchWindow()
			.getActivePage().findView(MedicationView.PART_ID);
		if (view != null) {
			if (event.getNewValue() == Boolean.FALSE) {
				view.setMedicationTableViewerComparator(ViewerSortOrder.DEFAULT);
			}
		}
	}
}
 
Example 4
Source File: JSPreferencePage.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void propertyChange(PropertyChangeEvent event)
{
	if (event.getSource() == enableFolding) // $codepro.audit.disable useEquals
	{
		Object newValue = event.getNewValue();
		if (Boolean.TRUE == newValue) // $codepro.audit.disable useEquals
		{
			foldComments.setEnabled(true, foldingGroup);
			foldFunctions.setEnabled(true, foldingGroup);
			foldObjects.setEnabled(true, foldingGroup);
			foldArrays.setEnabled(true, foldingGroup);
		}
		else
		{
			foldComments.setEnabled(false, foldingGroup);
			foldFunctions.setEnabled(false, foldingGroup);
			foldObjects.setEnabled(false, foldingGroup);
			foldArrays.setEnabled(false, foldingGroup);
		}
	}
	super.propertyChange(event);
}
 
Example 5
Source File: JenerateBasePreferencePage.java    From jenerate with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public void propertyChange(PropertyChangeEvent event) {
    super.propertyChange(event);

    if (event.getProperty().equals(FieldEditor.VALUE)) {

        if (event.getSource() == getCacheHashCodeField()) {
            getHashCodeCachingField().setEnabled(getCacheHashCodeField().getBooleanValue(), getFieldEditorParent());

        } else if (event.getSource() == getCacheToStringField()) {
            getToStringCachingField().setEnabled(getCacheToStringField().getBooleanValue(), getFieldEditorParent());

        } else
            if (event.getSource() == getHashCodeCachingField() || event.getSource() == getToStringCachingField()) {
            checkState();
        }
    }
}
 
Example 6
Source File: ParserPreferencePage.java    From tlaplus with MIT License 6 votes vote down vote up
/**
 * This overrides the method in {@link FieldEditorPreferencePage}.
 * It disables the parse spec on spec module modify if the parse
 * module on modify option is de-selected and enables it when parse
 * module on modify is selected.
 */
public void propertyChange(PropertyChangeEvent event)
{
    if (event.getSource() instanceof BooleanFieldEditor)
    {
        BooleanFieldEditor parseModuleOnModifyField = (BooleanFieldEditor) event.getSource();
        if (parseModuleOnModifyField.getPreferenceName().equals(IPreferenceConstants.I_PARSE_MODULE_ON_MODIFY))
        {
            boolean parseModuleOnModify = parseModuleOnModifyField.getBooleanValue();
            if (parseModuleOnModify)
            {
                parseSpecField.setEnabled(true, getFieldEditorParent());
            } else
            {
                parseSpecField.setEnabled(false, getFieldEditorParent());
            }
        }
    }
    super.propertyChange(event);
}
 
Example 7
Source File: DartPreferencePage.java    From dartboard with Eclipse Public License 2.0 6 votes vote down vote up
/**
 * Called when changes to the property fields of the page are made.
 *
 * This method performs a validity check on the fields.
 */
@Override
public void propertyChange(PropertyChangeEvent event) {
	if (event.getSource() instanceof RadioGroupFieldEditor) {
		flutterEnabledRadio.store();
		if (getPreferenceStore().getBoolean(GlobalConstants.P_FLUTTER_ENABLED)) {
			dartSDKLocationEditor.setEnabled(false);
			flutterSDKLocationFieldEditor.setEnabled(true);
		} else {
			dartSDKLocationEditor.setEnabled(true);
			flutterSDKLocationFieldEditor.setEnabled(false);
		}

	}
	super.propertyChange(event);
}
 
Example 8
Source File: GhidraSymbolLookupPreferencePage.java    From ghidra with Apache License 2.0 6 votes vote down vote up
@Override
public void propertyChange(PropertyChangeEvent event) {
	super.propertyChange(event);
	if (event.getProperty().equals(FieldEditor.VALUE)) {
		checkState();
	}
	if (event.getSource() == enabledField) {
		if (previousEnabledString == null) {
			previousEnabledString = event.getOldValue().toString();
		}
		currentEnabledString = event.getNewValue().toString();
	}
	else if (event.getSource() == portField) {
		if (previousPortString == null) {
			previousPortString = event.getOldValue().toString();
		}
		currentPortString = event.getNewValue().toString();
	}
}
 
Example 9
Source File: TmfTimestampFormatPage.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void propertyChange(PropertyChangeEvent event) {
    Object source = event.getSource();
    Object value = event.getNewValue();
    if (source instanceof RadioGroupFieldEditor && value instanceof String &&
            !(value.equals(fChangedProperty) && source.equals(fProperty)))
    {
        fProperty = ((RadioGroupFieldEditor) source).getPreferenceName();
        fChangedProperty = (String) value;
        refresh();
    }
}
 
Example 10
Source File: ControlPreferencePage.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void propertyChange(PropertyChangeEvent event) {

    if (event.getProperty().equals(FieldEditor.VALUE)) {
        if (event.getSource() instanceof FieldEditor) {
            FieldEditor editor = (FieldEditor) event.getSource();
            if (editor.getPreferenceName().equals(ControlPreferences.TRACE_CONTROL_LOG_COMMANDS_PREF)) {
                Boolean enabled = (Boolean)event.getNewValue();
                fVerboseLevel.setEnabled(enabled, getFieldEditorParent());
                fIsAppend.setEnabled(enabled, getFieldEditorParent());
            }
        }
    }
    super.propertyChange(event);
}
 
Example 11
Source File: HACPreferencePage.java    From hybris-commerce-eclipse-plugin with Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public void propertyChange(final PropertyChangeEvent event) {
	// not allowing blank fields on Preference page
	if (PreferencePage.Validation.EVENT_FIELD_EDITOR_VALUE.equals(event.getProperty())) {
		if (event.getSource() instanceof StringFieldEditor) {
			if (checkIfEmpty() && validateTimeout() && validateUrl()) {
				super.performApply();
				super.propertyChange(event);
				setValid(true);
			}
		}
	}
}
 
Example 12
Source File: ThemePreferencePage.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
public void propertyChange(PropertyChangeEvent event)
{
	Object value = event.getNewValue();
	if (value == null)
	{
		return;
	}

	RGB newColor = (RGB) value;
	Theme theme = getTheme();
	Object source = event.getSource();
	if (source == fgSelector)
	{
		theme.updateFG(newColor);
	}
	else if (source == selectionSelector)
	{
		theme.updateSelection(newColor);
	}
	else if (source == bgSelector)
	{
		theme.updateBG(newColor);
	}
	else if (source == lineHighlightSelector)
	{
		theme.updateLineHighlight(newColor);
	}
	else if (source == caretSelector)
	{
		theme.updateCaret(newColor);
	}
	setTheme(fSelectedTheme);
}
 
Example 13
Source File: AbstractDetailsPart.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public final void propertyChange(PropertyChangeEvent event) {
	if (event.getSource() instanceof FieldEditor) {
		FieldEditor fe = (FieldEditor) event.getSource();
		internalStore.setValue(fe.getPreferenceName(), fe.getPreferenceStore().getDefaultString(fe.getPreferenceName()));
		// store changed value in internalStore
		fe.setPreferenceStore(internalStore);
		fe.store();
		// reset preference store of fieldEditor to chained store, so it also works for other token styles.
		fe.setPreferenceStore(getPreferenceStore());
	}
	super.propertyChange(event);
}
 
Example 14
Source File: FieldLayoutPreferencePage.java    From tesb-studio-se with Apache License 2.0 5 votes vote down vote up
/**
 * The field editor preference page implementation of this <code>IPreferencePage</code> (and
 * <code>IPropertyChangeListener</code>) method intercepts <code>IS_VALID</code> events but passes other events on
 * to its superclass.
 */
@Override
public void propertyChange(PropertyChangeEvent event) {
    if (event.getProperty().equals(FieldEditor.IS_VALID)) {
        boolean newValue = ((Boolean) event.getNewValue()).booleanValue();
        // If the new value is true then we must check all field editors.
        // If it is false, then the page is invalid in any case.
        if (newValue) {
            checkState();
        } else {
            m_invalidFieldEditor = (FieldEditor) event.getSource();
            setValid(newValue);
        }
    }
}
 
Example 15
Source File: UpdateCheckerPreferencePage.java    From developer-studio with Apache License 2.0 5 votes vote down vote up
@Override
public void propertyChange(PropertyChangeEvent event) {
	FieldEditor fe = (FieldEditor) event.getSource();
	if (PreferenceConstants.ENABLE_AUTOMATIC_UPDATES.equals(fe.getPreferenceName())) {
		boolean isAutomaticUpdateEnabled = (boolean) event.getNewValue();
		updateSiteURL.setEnabled(isAutomaticUpdateEnabled, enableDisableSet);
		releaseSiteURL.setEnabled(isAutomaticUpdateEnabled, enableDisableSet);
		updateInstallationRadioBttn.setEnabled(isAutomaticUpdateEnabled, enableDisableSet);
		updateSchedulingRadioBttn.setEnabled(isAutomaticUpdateEnabled, enableDisableSet);
		if (preferenceStore.getString(PreferenceConstants.UPDATE_RUNNING_CONFIGURATION)
				.equals(PreferenceConstants.SCHEDULE)) {
			intervalDayEditor.setEnabled(true, enableDisableSet);
			intervalTimeEditor.setEnabled(true, enableDisableSet);
		}

	} else if (PreferenceConstants.UPDATE_RUNNING_CONFIGURATION.equals(fe.getPreferenceName())) {
		String newPref = null;
		boolean isScheduler = false;
		if (event.getNewValue() != null && !((String) event.getNewValue()).isEmpty()) {
			newPref = (String) event.getNewValue();
		}
		if (PreferenceConstants.SCHEDULE.equals(newPref)) {
			isScheduler = true;
		}
		intervalDayEditor.setEnabled(isScheduler, enableDisableSet);
		intervalTimeEditor.setEnabled(isScheduler, enableDisableSet);
	} 
	super.propertyChange(event);
}
 
Example 16
Source File: LabSettings.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void propertyChange(PropertyChangeEvent event){
	super.propertyChange(event);
	if (event.getSource() instanceof FieldEditor) {
		FieldEditor fe = ((FieldEditor) event.getSource());
		if (Preferences.LABSETTINGS_CFG_LOCAL_REFVALUES.equals(fe.getPreferenceName())) {
			if (event.getNewValue().equals(Boolean.TRUE)) {
				MessageDialog.openInformation(UiDesk.getTopShell(),
					Messages.LabSettings_enableUseLocalLabRefValues_title,
					Messages.LabSettings_enableUseLocalLabRefValues_text);
			}
		}
	}
}
 
Example 17
Source File: CppStylePerfPage.java    From CppStyle with MIT License 5 votes vote down vote up
@Override
public void propertyChange(PropertyChangeEvent event) {
	super.propertyChange(event);

	if (event.getProperty().equals(FieldEditor.VALUE)) {
		if (event.getSource() == clangFormatPath) {
			clangFormatPathChange(event.getNewValue().toString());
		} else if (event.getSource() == cpplintPath) {
			cpplintPathChange(event.getNewValue().toString());
		}

		checkState();
	}
}
 
Example 18
Source File: CommunicationPreferencePage.java    From saros with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void propertyChange(PropertyChangeEvent event) {

  if (event.getSource() instanceof FieldEditor) {
    FieldEditor field = (FieldEditor) event.getSource();

    if (field.getPreferenceName().equals(EclipsePreferenceConstants.CUSTOM_MUC_SERVICE)) {
      String serverName = event.getNewValue().toString();
      useCustomChatServer.setEnabled(!serverName.isEmpty(), getFieldEditorParent());
    }
  }
}
 
Example 19
Source File: BonitaLanguagePreferencePage.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void propertyChange(PropertyChangeEvent event) {
    if (event.getSource() == studioLocale) {
        newLocale = (String) event.getNewValue();
        String v = getPreferenceStore().getString(webLocale.getPreferenceName());
        String defaultValue = getPreferenceStore().getDefaultString(BonitaPreferenceConstants.CURRENT_UXP_LOCALE);
        getPreferenceStore().setDefault(BonitaPreferenceConstants.CURRENT_UXP_LOCALE, "");
        getPreferenceStore().setValue(BonitaPreferenceConstants.CURRENT_UXP_LOCALE, v);
        getPreferenceStore().setDefault(BonitaPreferenceConstants.CURRENT_UXP_LOCALE, defaultValue);
    }
    super.propertyChange(event);
}
 
Example 20
Source File: BonitaDatabasePreferencePage.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void propertyChange(final PropertyChangeEvent event) {
    if (event.getSource() == dropDB) {
        if (!(Boolean) event.getNewValue()) {
            BonitaStudioPreferencesPlugin.getDefault().getPreferenceStore()
                    .setValue(BonitaPreferenceConstants.LOAD_ORGANIZATION, false);
            checkbox.setSelection(false);
        }
        usersAndRoles.setEnabled((Boolean) event.getNewValue(), getFieldEditorParent());
    }
    super.propertyChange(event);
}