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


Java PropertyChangeEvent.getOldValue方法代码示例

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


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

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

示例4: 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();
	}
}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:38,代码来源:PrefPageMap2Appearance.java

示例5: onSelectColorInColorSelector

import org.eclipse.jface.util.PropertyChangeEvent; //导入方法依赖的package包/类
/**
 * is called when the color in the color selector has changed
 * 
 * @param event
 */
private void onSelectColorInColorSelector(final PropertyChangeEvent event) {

	final RGB oldValue = (RGB) event.getOldValue();
	final RGB newValue = (RGB) event.getNewValue();

	if (!oldValue.equals(newValue) && _selectedColor != null) {

		// color has changed

		// update the data model
		_selectedColor.setRGB(newValue);

		/*
		 * dispose the old color/image from the graph
		 */
		_graphColorPainter.invalidateResources(//
				_selectedColor.getColorId(),
				_selectedColor.getColorDefinition().getColorDefinitionId());

		/*
		 * update the tree viewer, the color images will then be recreated
		 */
		_colorViewer.update(_selectedColor, null);
		_colorViewer.update(_selectedColor.getColorDefinition(), null);

		_isColorChanged = true;
	}
}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:34,代码来源:PrefPageAppearanceColors.java

示例6: onChangeGraphColor

import org.eclipse.jface.util.PropertyChangeEvent; //导入方法依赖的package包/类
/**
 * Is called when the color in the color selector has changed
 * 
 * @param event
 */
private void onChangeGraphColor(final PropertyChangeEvent event) {

	final RGB oldRGB = (RGB) event.getOldValue();
	final RGB newRGB = (RGB) event.getNewValue();

	if (_selectedGraphColor == null || oldRGB.equals(newRGB)) {
		return;
	}

	// color has changed

	// update model
	_selectedGraphColor.setRGB(newRGB);

	final TourTypeColorDefinition selectedColorDefinition = (TourTypeColorDefinition) _selectedGraphColor
			.getColorDefinition();

	/*
	 * update tour type in the db
	 */
	final TourType oldTourType = selectedColorDefinition.getTourType();

	oldTourType.setColorBright(selectedColorDefinition.getGradientBright_New());
	oldTourType.setColorDark(selectedColorDefinition.getGradientDark_New());
	oldTourType.setColorLine(selectedColorDefinition.getLineColor_New());
	oldTourType.setColorText(selectedColorDefinition.getTextColor_New());

	final TourType savedTourType = saveTourType(oldTourType);

	selectedColorDefinition.setTourType(savedTourType);

	// replace tour type with new one
	_dbTourTypes.remove(oldTourType);
	_dbTourTypes.add(savedTourType);
	Collections.sort(_dbTourTypes);

	/*
	 * Update UI
	 */
	// invalidate old color/image from the graph and color definition to force the recreation
	_graphColorPainter.invalidateResources(//
			_selectedGraphColor.getColorId(),
			selectedColorDefinition.getColorDefinitionId());

	// update UI
	TourTypeImage.setTourTypeImagesDirty();

	/*
	 * update the tree viewer, the color images will be recreated in the label provider
	 */
	_tourTypeViewer.update(_selectedGraphColor, null);
	_tourTypeViewer.update(selectedColorDefinition, null);

	// without a repaint the color def image is not updated
	_tourTypeViewer.getTree().redraw();

	_isModified = true;
}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:64,代码来源:PrefPageTourTypes.java


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