本文整理汇总了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;
}
}
示例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());
}
}
});
}
}
示例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);
}
}
示例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()));
}
}
}
示例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));
}
}
示例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!
}
}
}
}
示例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);
}
示例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);
}
示例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();
}
}
示例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);
}
示例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());
}
}
示例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);
}
}
}
示例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);
}
示例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);
}
}