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


Java ValueChangeEvent类代码示例

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


ValueChangeEvent类属于org.eclipse.core.databinding.observable.value包,在下文中一共展示了ValueChangeEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: bind

import org.eclipse.core.databinding.observable.value.ValueChangeEvent; //导入依赖的package包/类
@Override
protected void bind ()
{
    this.dbc.bindValue ( SWTObservables.observeText ( this.label ), this.model, null, new UpdateValueStrategy ().setConverter ( new VariantToStringConverter () ) );
    this.model.addValueChangeListener ( new IValueChangeListener () {

        @Override
        public void handleValueChange ( final ValueChangeEvent event )
        {
            if ( !PlainDataItemLabel.this.label.isDisposed () )
            {
                PlainDataItemLabel.this.label.getParent ().layout ();
            }
        }
    } );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:17,代码来源:PlainDataItemLabel.java

示例2: setInput

import org.eclipse.core.databinding.observable.value.ValueChangeEvent; //导入依赖的package包/类
@Override
protected void setInput ( final IEditorInput input )
{
    final ConfigurationEditorInput configurationInput = (ConfigurationEditorInput)input;

    if ( !this.nested )
    {
        configurationInput.performLoad ( new NullProgressMonitor () );
    }

    this.dirtyValue = configurationInput.getDirtyValue ();
    this.dirtyValue.addValueChangeListener ( new IValueChangeListener () {

        @Override
        public void handleValueChange ( final ValueChangeEvent event )
        {
            firePropertyChange ( IEditorPart.PROP_DIRTY );
        }
    } );

    super.setInput ( input );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:23,代码来源:AbstractConfigurationEditor.java

示例3: attachListener

import org.eclipse.core.databinding.observable.value.ValueChangeEvent; //导入依赖的package包/类
public void attachListener(EObject target, final DetailProviderParameter parameter, final UniqueMultiselectWidget widget) {
	
	EStructuralFeature feature = (EStructuralFeature) parameter.getPropertyDescriptor().getFeature(target);
	final IObservableValue modelObservable = EMFObservables.observeValue(target, feature);
	final IValueChangeListener listener = new IValueChangeListener() {
		@Override
		public void handleValueChange(ValueChangeEvent event) {
			widget.updateWidget(getValues(parameter));
		}

	};
	modelObservable.addValueChangeListener(listener);
	widget.getControl().addDisposeListener(new DisposeListener() {
		@Override
		public void widgetDisposed(DisposeEvent e) {
			modelObservable.removeValueChangeListener(listener);
		}

	});
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:21,代码来源:UniqueMultiSelectBindingFactory.java

示例4: bindValidatorDecoration

import org.eclipse.core.databinding.observable.value.ValueChangeEvent; //导入依赖的package包/类
public static void bindValidatorDecoration(DetailProviderParameter parameter, final Control control) {
	final EObject target = parameter.getTarget();
	IItemPropertyDescriptor pd = parameter.getPropertyDescriptor();
	final EStructuralFeature feature = (EStructuralFeature) pd.getFeature(target);
	addControl(target, feature, control);
	final IObservableValue modelObservable = EMFObservables.observeValue(target, feature);
	final IValueChangeListener listener = new IValueChangeListener() {
		@Override
		public void handleValueChange(ValueChangeEvent event) {
			Object value = event.getObservableValue().getValue();
			validateFeatureValue(target, feature, value, control, true);
		}
	};
	modelObservable.addValueChangeListener(listener);
	control.addDisposeListener(new DisposeListener() {
		@Override
		public void widgetDisposed(DisposeEvent e) {
			modelObservable.removeValueChangeListener(listener);
			modelObservable.dispose();
			removeControl(target, feature, control);
			control.removeDisposeListener(this);
		}
	});
	validateFeatureValue(target, feature, modelObservable.getValue(), control, false);
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:26,代码来源:EMFDetailUtils.java

示例5: observeValueAndRunOnChange

import org.eclipse.core.databinding.observable.value.ValueChangeEvent; //导入依赖的package包/类
private void observeValueAndRunOnChange(final Widget widget, EObject object, EStructuralFeature feature, final Runnable runnable) {
	final IObservableValue valueObservable = EMFObservables.observeValue(object, feature);
	final IValueChangeListener valueChangeListener = new IValueChangeListener() {
		@Override
		public void handleValueChange(ValueChangeEvent event) {
			WidgetUtils.runInDisplayThread(widget, runnable);
		}
	};
	valueObservable.addValueChangeListener(valueChangeListener);
	widget.addDisposeListener(new DisposeListener() {
		@Override
		public void widgetDisposed(DisposeEvent e) {
			valueObservable.removeValueChangeListener(valueChangeListener);
		}
	});
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:17,代码来源:ADEffectMemberDetailProvider.java

示例6: createControl

import org.eclipse.core.databinding.observable.value.ValueChangeEvent; //导入依赖的package包/类
@Override
public void createControl(Composite parent) {
	
	super.createControl(parent);
	Composite control = (Composite) getControl();
	GridLayout layout = new GridLayout(1,false);
	control.setLayout(layout);
	PropertiesComposite composite = new PropertiesComposite(control, SWT.NONE);
	composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
	composite.bindValues(properties);
	IValueChangeListener valueChangeListener = new IValueChangeListener() {
		public void handleValueChange(ValueChangeEvent event) {
			setPageComplete(validatePage());
		}
	};
	properties.identifier.addValueChangeListener(valueChangeListener);
	properties.version.addValueChangeListener(valueChangeListener);
}
 
开发者ID:tmseidel,项目名称:commandline-hero,代码行数:19,代码来源:NewProjectWizardPage.java

示例7: observe

import org.eclipse.core.databinding.observable.value.ValueChangeEvent; //导入依赖的package包/类
public void observe(EObject eobject, EStructuralFeature sf){
	
	long id = (((long)eobject.hashCode()) << 32) + sf.getFeatureID();
	
	if(externalObservables.containsKey(id)){
		return;
	}
	
	IObservableValue ov = EMFObservables.observeValue(eobject, sf);
	ov.addValueChangeListener(new IValueChangeListener() {
		
		@Override
		public void handleValueChange(ValueChangeEvent event) {
			if(treeRow != null){
				treeRow.update();
			}
		}
	});
	
	externalObservables.put(id, ov);
}
 
开发者ID:CloudScale-Project,项目名称:Environment,代码行数:22,代码来源:TreeCell.java

示例8: myInitializations

import org.eclipse.core.databinding.observable.value.ValueChangeEvent; //导入依赖的package包/类
private void myInitializations() {
	Resource metamodelResource = this.manager.getConceptResource(this.metamodel);
	conceptTreeViewer.setInput(metamodelResource);

	// treeMetamodelUsageViewer.setInput(this.manager.computeStaticAnalysis(this.metamodel));
	
	
	// Get Dirty flag...
	IObservableValue revengModelTransformationObserveValue = EMFObservables.observeValue(manager.getModel(),
			Literals.REVENG_MODEL__TRANSFORMATION);
	revengModelTransformationObserveValue.addValueChangeListener(new IValueChangeListener() {
		@Override
		public void handleValueChange(ValueChangeEvent event) {
			markAsDirty();
		}
	});
}
 
开发者ID:jesusc,项目名称:bento,代码行数:18,代码来源:ConceptRefactoringPage.java

示例9: TimeShiftActionController

import org.eclipse.core.databinding.observable.value.ValueChangeEvent; //导入依赖的package包/类
public TimeShiftActionController ( final ControllerManager controllerManager, final ChartContext chartContext, final TimeShiftAction controller )
{
    super ( controllerManager.getContext (), chartContext, controller );

    final DataBindingContext ctx = controllerManager.getContext ();

    final Composite space = chartContext.getExtensionSpaceProvider ().getExtensionSpace ();
    if ( space != null )
    {
        this.button = new Button ( space, SWT.PUSH );
        this.button.addSelectionListener ( new SelectionAdapter () {
            @Override
            public void widgetSelected ( final SelectionEvent e )
            {
                action ();
            };
        } );
        addBinding ( ctx.bindValue ( PojoObservables.observeValue ( this, "milliseconds" ), EMFObservables.observeValue ( controller, ChartPackage.Literals.TIME_SHIFT_ACTION__DIFF ) ) ); //$NON-NLS-1$
        addBinding ( ctx.bindValue ( SWTObservables.observeText ( this.button ), EMFObservables.observeValue ( controller, ChartPackage.Literals.TIME_SHIFT_ACTION__LABEL ) ) );
        addBinding ( ctx.bindValue ( SWTObservables.observeTooltipText ( this.button ), EMFObservables.observeValue ( controller, ChartPackage.Literals.TIME_SHIFT_ACTION__DESCRIPTION ) ) );

        this.layoutListener = new IValueChangeListener () {

            @Override
            public void handleValueChange ( final ValueChangeEvent event )
            {
                space.layout ();
            }
        };

        this.labelProperty = EMFObservables.observeValue ( controller, ChartPackage.Literals.TIME_SHIFT_ACTION__LABEL );
        this.labelProperty.addValueChangeListener ( this.layoutListener );

        space.layout ();
    }
    else
    {
        this.button = null;
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:41,代码来源:TimeShiftActionController.java

示例10: bind

import org.eclipse.core.databinding.observable.value.ValueChangeEvent; //导入依赖的package包/类
@Override
protected void bind ()
{
    this.model.addValueChangeListener ( new IValueChangeListener () {

        @Override
        public void handleValueChange ( final ValueChangeEvent event )
        {
            if ( !SystemMessageLabel.this.label.isDisposed () )
            {
                process ( event.diff.getNewValue () );
            }
        }
    } );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:16,代码来源:SystemMessageExtension.java

示例11: bindValues

import org.eclipse.core.databinding.observable.value.ValueChangeEvent; //导入依赖的package包/类
/**
    * Bind values.
    */
   private void bindValues() {

List<String> existingNames = new ArrayList<String>();
// if (_attribute.getParent()!=null)
// for(Attribute attribute : _attribute.getParent().getChildren()) {
// existingNames.add(attribute.getName());
// }
bind(_nameText, _attribute, Attribute.PROP_NAME, new NotEmptyOrExistValidator(Collection.PROP_NAME, existingNames));
bind(_detailsText, _attribute, Attribute.PROP_DESCRIPTION, null);
final AggregateValidationStatus aggregateValidationStatus = new AggregateValidationStatus(_dbc.getValidationStatusProviders(), AggregateValidationStatus.MAX_SEVERITY);

aggregateValidationStatus.addValueChangeListener(new IValueChangeListener() {
    public void handleValueChange(ValueChangeEvent event) {
	// the invocation of the getValue method is necessary
	// the further changes will be fired
	aggregateValidationStatus.getValue();
	for (Object o : _dbc.getBindings()) {
	    Binding binding = (Binding) o;
	    IStatus status = (IStatus) binding.getValidationStatus().getValue();
	    Control control = null;
	    if (binding.getTarget() instanceof ISWTObservable) {
		ISWTObservable swtObservable = (ISWTObservable) binding.getTarget();
		control = (Control) swtObservable.getWidget();
	    }
	    ControlDecoration decoration = decoratorMap.get(control);
	    if (decoration != null) {
		if (status.isOK()) {
		    decoration.hide();
		} else {
		    decoration.setDescriptionText(status.getMessage());
		    decoration.show();
		}
	    }
	}
    }
});

   }
 
开发者ID:synergynet,项目名称:synergyview,代码行数:42,代码来源:NewAttributeWizardPage.java

示例12: bindValues

import org.eclipse.core.databinding.observable.value.ValueChangeEvent; //导入依赖的package包/类
/**
    * Bind values.
    */
   private void bindValues() {

List<String> existingCollectionNames = new ArrayList<String>();
for (String collectionName : _existingCollectionNames) {
    existingCollectionNames.add(collectionName);
}
bind(nameText, collection, Collection.PROP_NAME, new NotEmptyOrExistValidator(Collection.PROP_NAME, existingCollectionNames));
bind(detailsText, collection, Collection.PROP_DETAILS, null);
final AggregateValidationStatus aggregateValidationStatus = new AggregateValidationStatus(dbc.getValidationStatusProviders(), AggregateValidationStatus.MAX_SEVERITY);

aggregateValidationStatus.addValueChangeListener(new IValueChangeListener() {
    public void handleValueChange(ValueChangeEvent event) {
	// the invocation of the getValue method is necessary
	// the further changes will be fired
	aggregateValidationStatus.getValue();
	for (Object o : dbc.getBindings()) {
	    Binding binding = (Binding) o;
	    IStatus status = (IStatus) binding.getValidationStatus().getValue();
	    Control control = null;
	    if (binding.getTarget() instanceof ISWTObservable) {
		ISWTObservable swtObservable = (ISWTObservable) binding.getTarget();
		control = (Control) swtObservable.getWidget();
	    }
	    ControlDecoration decoration = decoratorMap.get(control);
	    if (decoration != null) {
		if (status.isOK()) {
		    decoration.hide();
		} else {
		    decoration.setDescriptionText(status.getMessage());
		    decoration.show();
		}
	    }
	}
    }
});

   }
 
开发者ID:synergynet,项目名称:synergyview,代码行数:41,代码来源:NewCollectionWizardPage.java

示例13: bindFields

import org.eclipse.core.databinding.observable.value.ValueChangeEvent; //导入依赖的package包/类
@Override
public <S> void bindFields(final BFormInstance<S, ?> formInstance, final BForm<S> form, boolean immediate) {
	Object context = formInstance.getBindingContext();
	if (context != null) {
		throw new UnsupportedOperationException("Binding context has been already set");
	}

	DataBindingContext dbCtx = createDataBindingContext(formInstance);

	final WritableValue formValue = new WritableValue(formInstance.getValue(), Object.class);
	final WritableValue presenterValue = new WritableValue(form.createPresenter(formInstance, formInstance.getValue()),
			BPresenter.class);

	formValue.addValueChangeListener(new IValueChangeListener() {

		@Override
		public void handleValueChange(ValueChangeEvent event) {
			presenterValue.setValue(form.createPresenter(formInstance, formInstance.getValue()));
		}
	});

	bindFormValue(dbCtx, formValue, form, formInstance);
	bindFormValidation(dbCtx, formValue, form, formInstance);
	recursiveAddBindings(dbCtx, formValue, formInstance, form, presenterValue, immediate);
	bindValidationSummaryError(dbCtx, formInstance);
	formInstance.setBindingContext(new EclipseBindingContext(dbCtx));
}
 
开发者ID:frincon,项目名称:abstractform,代码行数:28,代码来源:EclipseBindingToolkit.java

示例14: handleValueChange

import org.eclipse.core.databinding.observable.value.ValueChangeEvent; //导入依赖的package包/类
/**
 * {@inheritDoc}
 *
 */
@Override
public void handleValueChange(ValueChangeEvent event) {
    if (updating) {
        return;
    }
    dirty = true;
}
 
开发者ID:fabric8io,项目名称:data-mapper,代码行数:12,代码来源:SWTValueUpdater.java

示例15: handleValueChange

import org.eclipse.core.databinding.observable.value.ValueChangeEvent; //导入依赖的package包/类
@Override
public void handleValueChange ( final ValueChangeEvent event )
{
    LegendRenderer.this.renderer.refresh ();
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:6,代码来源:LegendRenderer.java


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