本文整理汇总了Java中org.eclipse.jface.util.PropertyChangeEvent.getSource方法的典型用法代码示例。如果您正苦于以下问题:Java PropertyChangeEvent.getSource方法的具体用法?Java PropertyChangeEvent.getSource怎么用?Java PropertyChangeEvent.getSource使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jface.util.PropertyChangeEvent
的用法示例。
在下文中一共展示了PropertyChangeEvent.getSource方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: propertyChange
import org.eclipse.jface.util.PropertyChangeEvent; //导入方法依赖的package包/类
/**
* 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);
}
示例2: propertyChange
import org.eclipse.jface.util.PropertyChangeEvent; //导入方法依赖的package包/类
@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();
}
}
}
示例3: propertyChange
import org.eclipse.jface.util.PropertyChangeEvent; //导入方法依赖的package包/类
@Override
public final void propertyChange(final PropertyChangeEvent event)
{
final Object eventSource = event.getSource();
if (eventSource instanceof BooleanFieldEditor)
{
final BooleanFieldEditor featureEnabledEditor = (BooleanFieldEditor) eventSource;
if (this.controlMapping.keySet().contains(featureEnabledEditor))
{
final boolean featureEnabled = featureEnabledEditor.getBooleanValue();
for (FieldEditor fieldEditor : this.controlMapping.get(featureEnabledEditor))
{
fieldEditor.setEnabled(featureEnabled, getFieldEditorParent());
}
}
}
// Updated the apply button in every case because the property change
// can be caused by a changed string or path value
this.updateApplyButton();
}
示例4: propertyChange
import org.eclipse.jface.util.PropertyChangeEvent; //导入方法依赖的package包/类
@Override
public void propertyChange(PropertyChangeEvent event) {
if (!key.equals(event.getProperty())) {
return;
}
Object oldValuePlain = event.getOldValue();
Object newValuePlain = event.getNewValue();
if (!isValid(oldValuePlain) || !isValid(newValuePlain)) {
return;
}
Object source = event.getSource();
if (!(source instanceof IWorkbenchPart)) {
return;
}
handleChange((IWorkbenchPart) source, (String) oldValuePlain, (String) newValuePlain);
}
开发者ID:Cooperate-Project,项目名称:CooperateModelingEnvironment,代码行数:20,代码来源:PropertyChangeHandlerBase.java
示例5: propertyChange
import org.eclipse.jface.util.PropertyChangeEvent; //导入方法依赖的package包/类
@Override
public void propertyChange(final PropertyChangeEvent event) {
super.propertyChange(event);
if (event.getSource() instanceof BooleanFieldEditor) {
final BooleanFieldEditor changedBooleanFieldEditor = (BooleanFieldEditor) event.getSource();
final Boolean parentEnabled = (Boolean) event.getNewValue();
for (final Entry<IPreference, FieldEditorWrapper> entry : fieldEditorMap.entrySet()) {
if (entry.getValue().getFieldEditor().equals(changedBooleanFieldEditor)) {
// Found!
for (final IPreference childPreference : entry.getKey().getChildren()) {
updateChildrenStatus(childPreference, parentEnabled);
}
break; // Done!
}
}
}
}
示例6: propertyChange
import org.eclipse.jface.util.PropertyChangeEvent; //导入方法依赖的package包/类
@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);
}
示例7: propertyChange
import org.eclipse.jface.util.PropertyChangeEvent; //导入方法依赖的package包/类
@Override
public void propertyChange(PropertyChangeEvent event)
{
if (event.getSource() == enableFolding)
{
Object newValue = event.getNewValue();
if (Boolean.TRUE == newValue)
{
foldComments.setEnabled(true, foldingGroup);
foldRules.setEnabled(true, foldingGroup);
}
else
{
foldComments.setEnabled(false, foldingGroup);
foldRules.setEnabled(false, foldingGroup);
}
}
super.propertyChange(event);
}
示例8: propertyChange
import org.eclipse.jface.util.PropertyChangeEvent; //导入方法依赖的package包/类
/**
* Enable or disable the reserved word section deprnds on the user input.
* if the user input is "NOCHANGE" in the reserved case section, the reserved word section is disabled,
* otherwise the option is enabled.
*
* @param PropertyChangeEvent event
*/
@Override
public void propertyChange(PropertyChangeEvent event) {
if(event.getSource() instanceof RadioGroupFieldEditor){
RadioGroupFieldEditor editor = (RadioGroupFieldEditor) event.getSource();
if(editor.getPreferenceName().equals(UroborosqlFormatterPreferenceInitializer.RESERVED_CASE)) {
if (CaseType.NOCHANGE.name().equals(event.getNewValue().toString())) {
this.reservedWordsEditor.setEnabled(false, getFieldEditorParent());
}else {
this.reservedWordsEditor.setEnabled(true, getFieldEditorParent());
}
}
}
}
开发者ID:future-architect,项目名称:eclipse-uroborosql-formatter,代码行数:21,代码来源:UroborosqlFormatterPreferencePage.java
示例9: propertyChange
import org.eclipse.jface.util.PropertyChangeEvent; //导入方法依赖的package包/类
/**
* {@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);
}
}
}
}
示例10: propertyChange
import org.eclipse.jface.util.PropertyChangeEvent; //导入方法依赖的package包/类
@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()));
fe.setPreferenceStore(internalStore);
fe.store();
}
super.propertyChange(event);
}
示例11: propertyChange
import org.eclipse.jface.util.PropertyChangeEvent; //导入方法依赖的package包/类
@Override
public void propertyChange(PropertyChangeEvent event) {
super.propertyChange(event);
Object source = event.getSource();
if (event.getProperty().equals(FieldEditor.VALUE)) {
this.updateFieldEditors();
}
if (getFields().contains(source)) {
this.compilerPreferencesModified = true;
}
}
示例12: propertyChange
import org.eclipse.jface.util.PropertyChangeEvent; //导入方法依赖的package包/类
@Override
public void propertyChange(PropertyChangeEvent event) {
super.propertyChange(event);
if (event.getProperty().equals("field_editor_value")) { //$NON-NLS-1$
if (event.getSource() == bfeUSE)
enableVirtualizers((Boolean) event.getNewValue());
else if (event.getSource() == cfeType) {
isSwap = event.getNewValue().equals(JRSwapFileVirtualizer.class.getName());
enableSwapVirtualizer(isSwap);
} else if (event.getSource() == mnumrec)
enableLimitRecords((Integer) event.getNewValue() >= 0);
else if (event.getSource() == bLimRec)
enableLimitRecords((Boolean) event.getNewValue());
}
}
示例13: propertyChange
import org.eclipse.jface.util.PropertyChangeEvent; //导入方法依赖的package包/类
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);
}
示例14: propertyChange
import org.eclipse.jface.util.PropertyChangeEvent; //导入方法依赖的package包/类
@Override
public void propertyChange(final PropertyChangeEvent event) {
final String eventProperty = event.getProperty();
if (eventProperty.equals(FieldEditor.VALUE)) {
_isModified = true;
if (event.getSource() == _editorTourPaintMethod) {
// display info for the selected paint method
final String newValue = (String) event.getNewValue();
final String oldValue = (String) event.getOldValue();
if (oldValue.equals(TOUR_PAINT_METHOD_SIMPLE)
&& newValue.equals(TOUR_PAINT_METHOD_COMPLEX)
&& net.tourbook.common.UI.IS_OSX) {
MessageDialog.openWarning(
getShell(),
Messages.Pref_MapLayout_Dialog_OSX_Warning_Title,
Messages.Pref_MapLayout_Dialog_OSX_Warning_Message);
}
setUIPaintMethodInfo(newValue);
}
enableControls();
}
super.propertyChange(event);
if (_chkLiveUpdate.getSelection()) {
performApply();
}
}
示例15: propertyChange
import org.eclipse.jface.util.PropertyChangeEvent; //导入方法依赖的package包/类
@Override
public void propertyChange(final PropertyChangeEvent event) {
// final String property = event.getProperty();
final Object source = event.getSource();
if (source instanceof FieldEditor) {
final String prefName = ((FieldEditor) source).getPreferenceName();
if (prefName.equals(IPhotoPreferences.PHOTO_VIEWER_COLOR_FOREGROUND)
|| prefName.equals(IPhotoPreferences.PHOTO_VIEWER_COLOR_BACKGROUND)
|| prefName.equals(IPhotoPreferences.PHOTO_VIEWER_COLOR_SELECTION_FOREGROUND)
|| prefName.equals(IPhotoPreferences.PHOTO_VIEWER_IS_SHOW_FILE_FOLDER)
|| prefName.equals(IPhotoPreferences.PHOTO_VIEWER_COLOR_FOLDER)
|| prefName.equals(IPhotoPreferences.PHOTO_VIEWER_COLOR_FILE)
|| prefName.equals(IPhotoPreferences.PHOTO_VIEWER_FONT)
//
) {
_isImageViewerUIModified = true;
}
}
/////// show selected font as text
// System.out.println(event.getNewValue());
// // TODO remove SYSTEM.OUT.PRINTLN
super.propertyChange(event);
}