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