本文整理汇总了Java中org.eclipse.jface.util.IPropertyChangeListener类的典型用法代码示例。如果您正苦于以下问题:Java IPropertyChangeListener类的具体用法?Java IPropertyChangeListener怎么用?Java IPropertyChangeListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IPropertyChangeListener类属于org.eclipse.jface.util包,在下文中一共展示了IPropertyChangeListener类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: attachVisibleExpression
import org.eclipse.jface.util.IPropertyChangeListener; //导入依赖的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 );
}
}
示例2: attachLazyExpression
import org.eclipse.jface.util.IPropertyChangeListener; //导入依赖的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 );
}
}
示例3: attachDefaultInstanceExpression
import org.eclipse.jface.util.IPropertyChangeListener; //导入依赖的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 () );
}
}
示例4: PreferenceSelectorStyleGenerator
import org.eclipse.jface.util.IPropertyChangeListener; //导入依赖的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 ();
}
示例5: AbstractEditorPreferences
import org.eclipse.jface.util.IPropertyChangeListener; //导入依赖的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();
}
}
});
}
示例6: start
import org.eclipse.jface.util.IPropertyChangeListener; //导入依赖的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());
}
}
});
}
示例7: SynchronizeLabelDecorator
import org.eclipse.jface.util.IPropertyChangeListener; //导入依赖的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));
}
}
});
}
示例8: createDialogArea
import org.eclipse.jface.util.IPropertyChangeListener; //导入依赖的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;
}
示例9: createContents
import org.eclipse.jface.util.IPropertyChangeListener; //导入依赖的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;
}
示例10: init
import org.eclipse.jface.util.IPropertyChangeListener; //导入依赖的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();
}
示例11: addOfflineChangedListener
import org.eclipse.jface.util.IPropertyChangeListener; //导入依赖的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");
}
}
}
});
}
示例12: FtcEditor
import org.eclipse.jface.util.IPropertyChangeListener; //导入依赖的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("");
}
}
});
}
示例13: TexlipseAnnotationUpdater
import org.eclipse.jface.util.IPropertyChangeListener; //导入依赖的package包/类
/**
* Creates a new TexlipseAnnotationUpdater and adds itself to the TexEditor via
* <code>addPostSelectionChangedListener</code>
* @param editor The TexEditor
*/
public TexlipseAnnotationUpdater (AbstractTextEditor editor) {
//Add this listener to the current editors IPostSelectionListener (lazy update)
((IPostSelectionProvider) editor.getSelectionProvider()).addPostSelectionChangedListener(this);
fEditor = editor;
fEnabled = TexlipsePlugin.getDefault().getPreferenceStore().getBoolean(
TexlipseProperties.TEX_EDITOR_ANNOTATATIONS);
//Add a PropertyChangeListener
TexlipsePlugin.getDefault().getPreferenceStore().addPropertyChangeListener(new
IPropertyChangeListener() {
public void propertyChange(PropertyChangeEvent event) {
String property = event.getProperty();
if (TexlipseProperties.TEX_EDITOR_ANNOTATATIONS.equals(property)) {
boolean enabled = TexlipsePlugin.getDefault().getPreferenceStore().getBoolean(
TexlipseProperties.TEX_EDITOR_ANNOTATATIONS);
fEnabled = enabled;
}
}
});
}
示例14: registerPropertyChangeListeners
import org.eclipse.jface.util.IPropertyChangeListener; //导入依赖的package包/类
private void registerPropertyChangeListeners() {
final IPreferenceStore store = getDefault().getPreferenceStore();
getDefault().getPreferenceStore().addPropertyChangeListener(new IPropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent event) {
String property = event.getProperty();
if (property.equals(CONFIG_VERBOSE.longName())) {
Logger.setVerbose(store.getBoolean(property));
} else if (property.equals(CONFIG_MAX_THREADS.longName())) {
DEFAULT_MAX_THREADS = store.getInt(property);
} else if (property.equals(CONFIG_QUEUES_SIZE.longName())) {
DEFAULT_QUEUE_SIZE = store.getInt(property);
} else if (property.equals(CONFIG_STREAM_BUFFERS_SIZE.longName())) {
DEFAULT_STREAM_BUFFER_SIZE = store.getInt(property);
} else if (property.equals(CONFIG_REMOVE_TEMP_TRACE_FILES.longName())) {
DEFAULT_REMOVE_TEMP_TRACE_FILES = store.getBoolean(property);
} else if (property.equals(CONFIG_MINIMIZE_MEMORY_USAGE.longName())) {
DEFAULT_MINIMIZE_MEMORY_USAGE = store.getBoolean(property);
}
}
});
}
示例15: TLCPreferencePage
import org.eclipse.jface.util.IPropertyChangeListener; //导入依赖的package包/类
/**
* Constructor
*/
public TLCPreferencePage()
{
super(GRID);
// Copy preference value to non-ui plugin.
TLCUIActivator.getDefault().getPreferenceStore().addPropertyChangeListener(new IPropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent event) {
final IPreferenceStore store = TLCActivator.getDefault().getPreferenceStore();
if (TLCActivator.I_TLC_SNAPSHOT_KEEP_COUNT.equals(event.getProperty())) {
store.setValue(TLCActivator.I_TLC_SNAPSHOT_KEEP_COUNT, (int)event.getNewValue());
}
}
});
setPreferenceStore(TLCUIActivator.getDefault().getPreferenceStore());
setDescription("TLC Model Checker preferences");
}