当前位置: 首页>>代码示例>>Java>>正文


Java PropertyChangeEvent.getNewValue方法代码示例

本文整理汇总了Java中org.eclipse.jface.util.PropertyChangeEvent.getNewValue方法的典型用法代码示例。如果您正苦于以下问题:Java PropertyChangeEvent.getNewValue方法的具体用法?Java PropertyChangeEvent.getNewValue怎么用?Java PropertyChangeEvent.getNewValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jface.util.PropertyChangeEvent的用法示例。


在下文中一共展示了PropertyChangeEvent.getNewValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getStrategy

import org.eclipse.jface.util.PropertyChangeEvent; //导入方法依赖的package包/类
/**
 * Returns with the strategy for the given property change even argument,
 *
 * @param event
 *            a property change argument.
 * @return a strategy encapsulating an actual working set manager modification.
 */
public WorkingSetManagerModificationStrategy getStrategy(final PropertyChangeEvent event) {

	if (event == null) {
		return NOOP;
	}

	final String property = event.getProperty();
	switch (property) {
	case CHANGE_WORKING_SET_ADD:
		return new AddWorkingSetModificationStrategy((IWorkingSet) event.getNewValue());
	case CHANGE_WORKING_SET_REMOVE:
		return new RemoveWorkingSetModificationStrategy((IWorkingSet) event.getOldValue());
	case CHANGE_WORKING_SET_LABEL_CHANGE: //$FALL-THROUGH$
	case CHANGE_WORKING_SET_NAME_CHANGE: //$FALL-THROUGH$
	case CHANGE_WORKING_SET_CONTENT_CHANGE:
		return new UpdateWorkingSetModificationStraregy(
				(IWorkingSet) event.getOldValue(),
				(IWorkingSet) event.getNewValue());
	default:
		return NOOP;
	}
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:30,代码来源:WorkingSetManagerModificationStrategyProvider.java

示例2: propertyChange

import org.eclipse.jface.util.PropertyChangeEvent; //导入方法依赖的package包/类
@Override
public void propertyChange(final PropertyChangeEvent event) {
    if (event.getNewValue() != null
            && PREF.FORCE_SHOW_CONSOLE.equals(event.getProperty())
            && !Objects.equals(event.getOldValue(), event.getNewValue())) {
        UiSync.exec(pageControl, new Runnable() {

            @Override
            public void run() {
                if (!pageControl.isDisposed()) {
                    setChecked((boolean) event.getNewValue());
                }
            }
        });
    }
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:17,代码来源:ShowConsoleParticipant.java

示例3: propertyChange

import org.eclipse.jface.util.PropertyChangeEvent; //导入方法依赖的package包/类
/**
 * @see IPropertyChangeListener#propertyChange(PropertyChangeEvent)
 */
public void propertyChange(PropertyChangeEvent event) {
    String property = event.getProperty();
    if (property == ISVNUIConstants.PREF_SVNINTERFACE) {
        String newValue = (String)event.getNewValue();
        setSvnClientInterface(newValue);
    }
    if (property == ISVNUIConstants.PREF_SVNCONFIGDIR) {
    	String configDir = (String)event.getNewValue();
        setSvnClientConfigDir(configDir);
    }
    if (property == ISVNUIConstants.PREF_FETCH_CHANGE_PATH_ON_DEMAND) {
    	boolean fetchChangePathOnDemand = ((Boolean) event.getNewValue()).booleanValue();
    	setSvnChangePathOnDemand(fetchChangePathOnDemand);        	
    }
        
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:20,代码来源:Preferences.java

示例4: adaptToColorChange

import org.eclipse.jface.util.PropertyChangeEvent; //导入方法依赖的package包/类
private void adaptToColorChange(Token token, PropertyChangeEvent event) {
	RGB rgb = null;

	Object value = event.getNewValue();
	if (value instanceof RGB) {
		rgb = (RGB) value;
	} else if (value instanceof String) {
		rgb = StringConverter.asRGB((String) value);
	}

	if (rgb != null) {

		String property = event.getProperty();
		Color color = colorMgr.getColor(property);
		if (!rgb.equals(color.getRGB())) {
			colorMgr.setValue(property, rgb);
			color = colorMgr.getColor(property);
		}

		Object data = token.getData();
		if (data instanceof TextAttribute) {
			TextAttribute oldAttr = (TextAttribute) data;
			token.setData(new TextAttribute(color, oldAttr.getBackground(), oldAttr.getStyle()));
		}
	}
}
 
开发者ID:grosenberg,项目名称:fluentmark,代码行数:27,代码来源:AbstractBufferedRuleBasedScanner.java

示例5: adaptToStyleChange

import org.eclipse.jface.util.PropertyChangeEvent; //导入方法依赖的package包/类
private void adaptToStyleChange(Token token, PropertyChangeEvent event, int styleAttribute) {
	boolean eventValue = false;
	Object value = event.getNewValue();
	if (value instanceof Boolean)
		eventValue = ((Boolean) value).booleanValue();
	else if (IPreferenceStore.TRUE.equals(value)) eventValue = true;

	Object data = token.getData();
	if (data instanceof TextAttribute) {
		TextAttribute oldAttr = (TextAttribute) data;
		boolean activeValue = (oldAttr.getStyle() & styleAttribute) == styleAttribute;
		if (activeValue != eventValue)
			token.setData(new TextAttribute(oldAttr.getForeground(), oldAttr.getBackground(),
					eventValue ? oldAttr.getStyle() | styleAttribute : oldAttr.getStyle() & ~styleAttribute));
	}
}
 
开发者ID:grosenberg,项目名称:fluentmark,代码行数:17,代码来源:AbstractBufferedRuleBasedScanner.java

示例6: 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

示例7: 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!
			}
		}
	}
}
 
开发者ID:Albertus82,项目名称:JFaceUtils,代码行数:18,代码来源:BasePreferencePage.java

示例8: 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);
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:24,代码来源:JSPreferencePage.java

示例9: 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);
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:20,代码来源:CSSPreferencePage.java

示例10: handlePreferenceStoreChanged

import org.eclipse.jface.util.PropertyChangeEvent; //导入方法依赖的package包/类
public void handlePreferenceStoreChanged(PropertyChangeEvent event)
{
	if (event.getProperty().equals(IThemeManager.THEME_CHANGED))
	{
		IThemeableEditor editor = this.fEditor.get();
		overrideThemeColors();
		if (editor != null)
		{
			editor.getISourceViewer().invalidateTextPresentation();
		}
	}
	else if (event.getProperty().equals(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE))
	{
		Object newValue = event.getNewValue();
		if (newValue instanceof Boolean)
		{
			boolean on = (Boolean) newValue;
			fFullLineBackgroundPainter.setHighlightLineEnabled(on);
		}
	}
	else if (event.getProperty().equals(AbstractTextEditor.PREFERENCE_COLOR_SELECTION_BACKGROUND_SYSTEM_DEFAULT))
	{
		overrideRulerColors();
	}
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:26,代码来源:ThemeableEditorExtension.java

示例11: addPrefListener

import org.eclipse.jface.util.PropertyChangeEvent; //导入方法依赖的package包/类
private void addPrefListener() {

		_prefListener = new IPropertyChangeListener() {

			@Override
			public void propertyChange(final PropertyChangeEvent event) {

				final String property = event.getProperty();
				if (property.equals(ITourbookPreferences.APPEARANCE_SHOW_TOUR_TYPE_CONTEXT_MENU)) {

					if (event.getNewValue() instanceof Boolean) {
						_isShowTourTypeContextMenu = (Boolean) event.getNewValue();
					}
				}
			}
		};

		_prefStore.addPropertyChangeListener(_prefListener);
	}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:20,代码来源:TourTypeContributionItem.java

示例12: propertyChange

import org.eclipse.jface.util.PropertyChangeEvent; //导入方法依赖的package包/类
@Override
public void propertyChange(PropertyChangeEvent event) {
    if (outer != null && event.getNewValue() != null
            && PREF.FORCE_SHOW_CONSOLE.equals(event.getProperty())
            && !Objects.equals(event.getOldValue(), event.getNewValue())) {
        outer.setActivateOnWrite((boolean) event.getNewValue());
    }
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:9,代码来源:CodekeeperConsole.java

示例13: propertyChange

import org.eclipse.jface.util.PropertyChangeEvent; //导入方法依赖的package包/类
public void propertyChange(PropertyChangeEvent event) {
	if (ITLA2TeXPreferenceConstants.DOT_COMMAND.equals(event.getProperty())) {
		final String dotCommand = (String) event.getNewValue();
		if ("dot".equals(dotCommand)) {
			// Setting it to "dot" implies auto lookup.
			TLA2TeXActivator.this.logInfo("dot command set to automatic lookup.");
			GraphVizActivator.getInstance().setDotSearchMethod(DotMethod.AUTO);
		} else {
			// Explicit path is given.
			TLA2TeXActivator.this.logInfo("dot command set to: " + dotCommand);
			GraphVizActivator.getInstance().setDotSearchMethod(DotMethod.MANUAL);
			GraphVizActivator.getInstance().setManualDotPath(dotCommand);
		}
	}
}
 
开发者ID:tlaplus,项目名称:tlaplus,代码行数:16,代码来源:TLA2TeXActivator.java

示例14: addPropertyChangeListener

import org.eclipse.jface.util.PropertyChangeEvent; //导入方法依赖的package包/类
protected void addPropertyChangeListener() {
	propertyChangeListener = new IPropertyChangeListener() {
		public void propertyChange(PropertyChangeEvent event) {
			if (getPreferenceKey().equals(event.getProperty()) && event.getOldValue() != event.getNewValue()) {
				boolean newValue = Boolean.parseBoolean(event.getNewValue().toString());
				stateChanged(newValue);
				getAction().setChecked(newValue);
			}
		}
	};
	preferenceStore = preferenceStoreAccess.getPreferenceStore();
	preferenceStore.addPropertyChangeListener(propertyChangeListener);
}
 
开发者ID:cplutte,项目名称:bts,代码行数:14,代码来源:AbstractToggleActionContributor.java

示例15: propertyChange

import org.eclipse.jface.util.PropertyChangeEvent; //导入方法依赖的package包/类
public void propertyChange(PropertyChangeEvent event) {
	try {
		// whenever this changes, we have to reload the
		// list of error messages
		binaryPath = (String) event.getNewValue();
		initProfileProblems(binaryPath);
	} catch (Exception e) {
		CppcheclipsePlugin.logError("Error reloading the problems", e);
	}
}
 
开发者ID:kwin,项目名称:cppcheclipse,代码行数:11,代码来源:ProblemProfile.java


注:本文中的org.eclipse.jface.util.PropertyChangeEvent.getNewValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。