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


Java PropertyChangeEvent类代码示例

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


PropertyChangeEvent类属于org.eclipse.jface.util包,在下文中一共展示了PropertyChangeEvent类的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: attachVisibleExpression

import org.eclipse.jface.util.PropertyChangeEvent; //导入依赖的package包/类
private void attachVisibleExpression ( final ViewInstanceDescriptor descriptor, final IEvaluationService evaluationService )
{
    if ( descriptor.getVisibleExpression () != null )
    {
        this.visibileRef = evaluationService.addEvaluationListener ( descriptor.getVisibleExpression (), new IPropertyChangeListener () {

            @Override
            public void propertyChange ( final PropertyChangeEvent event )
            {
                if ( PROP_VISIBLE.equals ( event.getProperty () ) && event.getNewValue () instanceof Boolean )
                {
                    setVisibleState ( (Boolean)event.getNewValue () );
                }
            }
        }, PROP_VISIBLE );
    }
    else
    {
        setVisibleState ( true );
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:22,代码来源:AbstractViewInstance.java

示例3: attachLazyExpression

import org.eclipse.jface.util.PropertyChangeEvent; //导入依赖的package包/类
private void attachLazyExpression ( final ViewInstanceDescriptor descriptor, final IEvaluationService evaluationService )
{
    if ( descriptor.getLazyExpression () != null )
    {
        this.lazyRef = evaluationService.addEvaluationListener ( descriptor.getLazyExpression (), new IPropertyChangeListener () {

            @Override
            public void propertyChange ( final PropertyChangeEvent event )
            {
                if ( PROP_LAZY.equals ( event.getProperty () ) && event.getNewValue () instanceof Boolean )
                {
                    setLazy ( (Boolean)event.getNewValue () );
                }
            }
        }, PROP_LAZY );
    }
    else
    {
        setLazy ( false );
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:22,代码来源:AbstractViewInstance.java

示例4: attachDefaultInstanceExpression

import org.eclipse.jface.util.PropertyChangeEvent; //导入依赖的package包/类
private void attachDefaultInstanceExpression ( final ViewInstanceDescriptor descriptor, final IEvaluationService evaluationService )
{
    if ( descriptor.getDefaultInstanceExpression () != null )
    {
        this.defaultInstanceRef = evaluationService.addEvaluationListener ( descriptor.getDefaultInstanceExpression (), new IPropertyChangeListener () {

            @Override
            public void propertyChange ( final PropertyChangeEvent event )
            {
                if ( PROP_DEFAULT_INSTANCE.equals ( event.getProperty () ) && event.getNewValue () instanceof Boolean )
                {
                    setDefaultInstance ( (Boolean)event.getNewValue () );
                }
            }
        }, PROP_DEFAULT_INSTANCE );
    }
    else
    {
        setDefaultInstance ( descriptor.isDefaultInstance () );
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:22,代码来源:AbstractViewInstance.java

示例5: PreferenceSelectorStyleGenerator

import org.eclipse.jface.util.PropertyChangeEvent; //导入依赖的package包/类
public PreferenceSelectorStyleGenerator ( final IPreferenceStore preferenceStore )
{
    this.preferenceStore = preferenceStore;
    this.preferenceStore.addPropertyChangeListener ( new IPropertyChangeListener () {

        @Override
        public void propertyChange ( final PropertyChangeEvent event )
        {
            logger.trace ( "Property change - name: {}, newValue: {}", event.getProperty (), event.getNewValue () ); //$NON-NLS-1$
            if ( PreferenceConstants.PREF_STYLE_GENERATOR_ID.equals ( event.getProperty () ) )
            {
                logger.info ( "Change of style generator: {}", event.getNewValue () ); //$NON-NLS-1$
                handleChange ( event.getNewValue () );
            }
        }
    } );

    setInitial ();
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:20,代码来源:PreferenceSelectorStyleGenerator.java

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

示例7: AbstractEditorPreferences

import org.eclipse.jface.util.PropertyChangeEvent; //导入依赖的package包/类
public AbstractEditorPreferences() {
	store = createStore();
	store.addPropertyChangeListener(new IPropertyChangeListener() {
		
		@Override
		public void propertyChange(PropertyChangeEvent event) {
			if (event==null){
				return;
			}
			String property = event.getProperty();
			if (property==null){
				return;
			}
			boolean colorChanged = checkPropertyMeansEditorColorsChanged(property);
			if (colorChanged){
				updateColorsInEditors();
			}
			
			
		}
		
	});
}
 
开发者ID:de-jcup,项目名称:egradle,代码行数:24,代码来源:AbstractEditorPreferences.java

示例8: start

import org.eclipse.jface.util.PropertyChangeEvent; //导入依赖的package包/类
@Override
public void start(BundleContext context) throws Exception {
  plugin = this;
  super.start(context);
  this.command = new BazelCommand(new BazelAspectLocationImpl(), new CommandConsoleFactoryImpl());
  // Get the bazel path from the settings
  this.command.setBazelPath(getPreferenceStore().getString("BAZEL_PATH"));
  getPreferenceStore().addPropertyChangeListener(new IPropertyChangeListener() {
    @Override
    public void propertyChange(PropertyChangeEvent event) {
      if (event.getProperty().equals("BAZEL_PATH")) {
        command.setBazelPath(event.getNewValue().toString());
      }
    }
  });
}
 
开发者ID:bazelbuild,项目名称:eclipse,代码行数:17,代码来源:Activator.java

示例9: SynchronizeLabelDecorator

import org.eclipse.jface.util.PropertyChangeEvent; //导入依赖的package包/类
public SynchronizeLabelDecorator(final Subscriber subscriber) {
    this.subscriber = subscriber;

    preferenceStore = new ScopedPreferenceStore(new InstanceScope(), TEAM_UI_PLUGIN_ID);

    decorate = Boolean.TRUE.equals(preferenceStore.getBoolean(DECORATION_PREFERENCE_CONSTANT));

    preferenceStore.addPropertyChangeListener(new IPropertyChangeListener() {
        @Override
        public void propertyChange(final PropertyChangeEvent event) {
            if (event.getProperty().equals(DECORATION_PREFERENCE_CONSTANT)) {
                /*
                 * Note that we compare against the string value of the
                 * preference here. Preferences are not strongly typed
                 * (they're strings under the hood), so in the property
                 * change event, we're given the string value.
                 */
                decorate = "true".equals(event.getNewValue()); //$NON-NLS-1$

                ((ILabelProviderListener) listeners.getListener()).labelProviderChanged(
                    new LabelProviderChangedEvent(SynchronizeLabelDecorator.this));
            }
        }
    });
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:26,代码来源:SynchronizeLabelDecorator.java

示例10: createDialogArea

import org.eclipse.jface.util.PropertyChangeEvent; //导入依赖的package包/类
protected Control createDialogArea(Composite parent) {
	getShell().setText(Policy.bind("ReleaseCommentDialog.title")); //$NON-NLS-1$
	Composite composite = new Composite(parent, SWT.NULL);
	composite.setLayout(new GridLayout());
	composite.setLayoutData(new GridData(GridData.FILL_BOTH));
	
	commitCommentArea.createArea(composite);
	commitCommentArea.addPropertyChangeListener(new IPropertyChangeListener() {
		public void propertyChange(PropertyChangeEvent event) {
			if (event.getProperty() == CommitCommentArea.OK_REQUESTED)
				okPressed();
		}
	});
	
	// set F1 help
	PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IHelpContextIds.RELEASE_COMMENT_DIALOG);	
	
	return composite;
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:20,代码来源:ReleaseCommentDialog.java

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

示例12: createContents

import org.eclipse.jface.util.PropertyChangeEvent; //导入依赖的package包/类
@Override
public Control createContents(Composite parent) {
  Composite container = new Composite(parent, SWT.NONE);
  parent.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  fieldEditor = createFieldEditor(container);
  fieldEditor.setPage(messages);
  fieldEditor.setPropertyChangeListener(new IPropertyChangeListener() {
    @Override
    public void propertyChange(PropertyChangeEvent event) {
      if (FieldEditor.IS_VALID.equals(event.getProperty())) {
        fireValueChanged(IS_VALID, event.getOldValue(), event.getNewValue());
      } else if (FieldEditor.VALUE.equals(event.getProperty())) {
        fireValueChanged(VALUE, event.getOldValue(), event.getNewValue());
      }
    }
  });
  fieldEditor.setPreferenceStore(getPreferenceStore());
  fieldEditor.load();
  fieldEditor.fillIntoGrid(container, fieldEditor.getNumberOfControls());
  return container;
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:22,代码来源:FieldEditorWrapper.java

示例13: init

import org.eclipse.jface.util.PropertyChangeEvent; //导入依赖的package包/类
@Override
public void init(IPageBookViewPage page, IConsole console) {
  Preconditions.checkArgument(console instanceof DeployConsole,
                              "console should be instance of %s",
                              DeployConsole.class.getName());
  this.console = (DeployConsole) console;

  console.addPropertyChangeListener(new IPropertyChangeListener() {
    @Override
    public void propertyChange(PropertyChangeEvent event) {
      if (event.getProperty().equals(DeployConsole.PROPERTY_JOB)) {
        // keep the order of adding a listener and then calling update() to ensure update
        // is called regardless of when the job finishes
        addJobChangeListener();
        update();
      }
    }
  });
  IActionBars actionBars = page.getSite().getActionBars();
  configureToolBar(actionBars.getToolBarManager());
  // keep the order of adding a listener and then calling update() to ensure update
  // is called regardless of when the job finishes
  addJobChangeListener();
  update();
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:26,代码来源:DeployConsolePageParticipant.java

示例14: addOfflineChangedListener

import org.eclipse.jface.util.PropertyChangeEvent; //导入依赖的package包/类
@Override
public void addOfflineChangedListener(OnValueChanged<Boolean> onChange) {
	preferenceStore.addPropertyChangeListener(new IPropertyChangeListener() {
		@Override
		public void propertyChange(PropertyChangeEvent event) {
			if (event.getProperty().equals(FtcPreferenceStore.KEY_OFFLINE)) {
				boolean recent = offline;
				offline = Unbox.asBoolean(event.getNewValue());
				if (recent != offline) {
					onChange.notify(offline);
					refreshEditors();
					if (offline)
						logging.Info("working offline");
				}
			}
		}
	});

}
 
开发者ID:curiosag,项目名称:ftc,代码行数:20,代码来源:FtcPluginFrontEnd.java

示例15: FtcEditor

import org.eclipse.jface.util.PropertyChangeEvent; //导入依赖的package包/类
public FtcEditor() {
	super();
	sourceViewerConfiguration = new FtcSourceViewerConfiguration();
	setSourceViewerConfiguration(sourceViewerConfiguration);

	IPreferenceStore pref = FtcPluginClient.getDefault().getPreferenceStore();
	showCaretPosition = pref.getBoolean(FtcPreferenceStore.KEY_SHOW_CARETPOS);

	pref.addPropertyChangeListener(new IPropertyChangeListener() {
		@Override
		public void propertyChange(PropertyChangeEvent event) {
			if (event.getProperty().equals(FtcPreferenceStore.KEY_SHOW_CARETPOS)) {
				showCaretPosition = Unbox.asBoolean(event.getNewValue());
				if (!showCaretPosition)
					setStatusLineMessage("");
			}
		}
	});

}
 
开发者ID:curiosag,项目名称:ftc,代码行数:21,代码来源:FtcEditor.java


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