當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。