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


Java ChangeEvent类代码示例

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


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

示例1: reloadOnValueChange

import org.eclipse.core.databinding.observable.ChangeEvent; //导入依赖的package包/类
public void reloadOnValueChange(EObject eobject, EStructuralFeature feature){
	
	long id = (((long)eobject.hashCode()) << 32) + feature.getFeatureID();
	
	if(externalObservables.containsKey(id)){
		return;
	}
	
	TransactionalEditingDomain ed = TransactionalEditingDomain.Factory.INSTANCE.getEditingDomain(
       		eobject.eResource().getResourceSet());
	
	IObservableList o = EMFEditObservables.observeList(ed, eobject, feature);
	o.addChangeListener(new IChangeListener() {
		
		@Override
		public void handleChange(ChangeEvent event) {
			reload();
		}
	});
	
	externalObservables.put(id, o);
}
 
开发者ID:CloudScale-Project,项目名称:Environment,代码行数:23,代码来源:TreeRow.java

示例2: reloadOnListChange

import org.eclipse.core.databinding.observable.ChangeEvent; //导入依赖的package包/类
public void reloadOnListChange(EObject eobject, EStructuralFeature feature){

		long id = (((long)eobject.hashCode()) << 32) + feature.getFeatureID();

		if(externalObservables.containsKey(id)){
			return;
		}

		TransactionalEditingDomain ed = TransactionalEditingDomain.Factory.INSTANCE.getEditingDomain(
        		eobject.eResource().getResourceSet());
		
		IObservableValue o = EMFEditObservables.observeValue(ed, eobject, feature);
		o.addChangeListener(new IChangeListener() {
			
			@Override
			public void handleChange(ChangeEvent event) {
				reload();
			}
		});

		externalObservables.put(id, o);
	}
 
开发者ID:CloudScale-Project,项目名称:Environment,代码行数:23,代码来源:TreeRow.java

示例3: ConfigurationEditorInput

import org.eclipse.core.databinding.observable.ChangeEvent; //导入依赖的package包/类
public ConfigurationEditorInput ( final String connectionUri, final String factoryId, final String configurationId )
{
    this.connectionUri = connectionUri;
    this.factoryId = factoryId;
    this.configurationId = configurationId;

    this.dataMap.addChangeListener ( new IChangeListener () {

        @Override
        public void handleChange ( final ChangeEvent event )
        {
            ConfigurationEditorInput.this.dirtyValue.setValue ( true );
        }
    } );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:16,代码来源:ConfigurationEditorInput.java

示例4: createBasicControl

import org.eclipse.core.databinding.observable.ChangeEvent; //导入依赖的package包/类
private void createBasicControl(Composite container) {
	GridLayout layout = new GridLayout();
	container.setLayout(layout);
	layout.numColumns = 6;
	layout.verticalSpacing = 10;
	layout.marginTop = 10;
	layout.marginWidth = 10;
	createErrorLabel(container);
	createColumnInfoControl(container);
	final ISWTObservableValue observableValue = SWTObservables.observeText(errorLabel);
	errorLabel.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
	dataBindingContext.bindValue(observableValue, new AggregateValidationStatus(dataBindingContext.getBindings(),
			AggregateValidationStatus.MAX_SEVERITY), null, null);
	observableValue.addChangeListener(new IChangeListener() {
		public void handleChange(ChangeEvent event) {
			if (observableValue.getValue().equals("OK")) {
				errorLabel.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_BLACK));
				errorLabel.setText(DIALOG_MESSAGE);
				buttonOk.setEnabled(true);
			} else {
				errorLabel.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
				buttonOk.setEnabled(false);
			}
		}
	});

}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:28,代码来源:ColumnDialog.java

示例5: aggregateValidationStatus

import org.eclipse.core.databinding.observable.ChangeEvent; //导入依赖的package包/类
/**
 * aggregates the validation status for given {@link DataBindingContext}
 *
 * @param bindingContext
 * @return
 */
public static AggregateValidationStatus aggregateValidationStatus(final DataBindingContext bindingContext) {
	final AggregateValidationStatus aggregateStatus = new AggregateValidationStatus(bindingContext,
			AggregateValidationStatus.MAX_SEVERITY);
	aggregateStatus.addChangeListener(new IChangeListener() {

		@Override
		public void handleChange(final ChangeEvent event) {
			// TODO refactor - can lead to StackOverflowError
			for (final Object o : bindingContext.getBindings()) {
				final Binding binding = (Binding) o;
				final IStatus status = (IStatus) binding.getValidationStatus().getValue();

				Control control = null;
				if (binding.getTarget() instanceof ISWTObservableValue) {
					final ISWTObservableValue swtObservableValue = (ISWTObservableValue) binding.getTarget();
					control = (Control) swtObservableValue.getWidget();
				}
				final ControlDecoration decoration = decorations.get(control);
				if (decoration != null && !control.isDisposed()) {
					if (status.isOK()) {
						decoration.hide();
					} else {
						decoration.setDescriptionText(status.getMessage());
						decoration.show();
					}
				}
			}
		}
	});
	return aggregateStatus;

}
 
开发者ID:FI13,项目名称:afbb-bibo,代码行数:39,代码来源:BindingHelper.java

示例6: handleValidationStatusChange

import org.eclipse.core.databinding.observable.ChangeEvent; //导入依赖的package包/类
private void handleValidationStatusChange(ChangeEvent event) {
    AggregateValidationStatus status = (AggregateValidationStatus) event.getObservable();
    IStatus validationStatus = status.getValue();
    if (validationStatus.getSeverity() == IStatus.OK) {
        validationErrorMessage.setValue(null);
    } else {
        validationErrorMessage.setValue(validationStatus.getMessage());
    }
}
 
开发者ID:Cooperate-Project,项目名称:CooperateModelingEnvironment,代码行数:10,代码来源:RenameUMLElementRefactoringWizardUserPageComposite.java

示例7: handleChange

import org.eclipse.core.databinding.observable.ChangeEvent; //导入依赖的package包/类
private void handleChange(ChangeEvent ce) {
    if (fd == null) {
        return;
    }
    if (ce.getObservable() == muteStatus) {
        fd.setMute(muteStatus.getValue());
    }
}
 
开发者ID:Cooperate-Project,项目名称:CooperateModelingEnvironment,代码行数:9,代码来源:FocusViewModel.java

示例8: handleValidationStatusChange

import org.eclipse.core.databinding.observable.ChangeEvent; //导入依赖的package包/类
private void handleValidationStatusChange(ChangeEvent e) {
	AggregateValidationStatus status = (AggregateValidationStatus)e.getObservable();
	IStatus validationStatus = status.getValue();
	if (validationStatus.getSeverity() == IStatus.OK) {
		setOK();
	} else {
		setError(validationStatus);
	}
}
 
开发者ID:Cooperate-Project,项目名称:CooperateModelingEnvironment,代码行数:10,代码来源:ValidationProcessor.java

示例9: handleChange

import org.eclipse.core.databinding.observable.ChangeEvent; //导入依赖的package包/类
@Override
public void handleChange(ChangeEvent event) {
	getRealm().asyncExec(new Runnable() {

		@Override
		public void run() {
			fireChange();
		}
		
	});
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:12,代码来源:DuplexingObservableList.java

示例10: handleChange

import org.eclipse.core.databinding.observable.ChangeEvent; //导入依赖的package包/类
@Override
public void handleChange(ChangeEvent event) {
	if (!this.run) {
		return;			
	}
	
	AggregateValidationStatus status = (AggregateValidationStatus)event.getObservable();
	IStatus validationStatus = (IStatus) status.getValue();
	if (validationStatus.getSeverity() == IStatus.OK) {
		setOK();
	} else {
		setError(validationStatus);
	}
}
 
开发者ID:SENSIDL-PROJECT,项目名称:SensIDL,代码行数:15,代码来源:SensidlProjectWizardChangeListener.java

示例11: initDataBindings

import org.eclipse.core.databinding.observable.ChangeEvent; //导入依赖的package包/类
protected DataBindingContext initDataBindings()
{
	final DataBindingContext bindingContext = new DataBindingContext();
	//
	IObservableValue observeTextTextServerURLObserveWidget = WidgetProperties.text(SWT.Modify).observeDelayed(
			BTSUIConstants.DELAY, textServerURL);
	IObservableValue bytesUrlObserveValue = PojoProperties.value("url").observe(connection);
	UpdateValueStrategy strategy = new UpdateValueStrategy();
	strategy.setAfterGetValidator(new StringHttp_s_URLValidator());
	Binding binding0 = bindingContext.bindValue(observeTextTextServerURLObserveWidget, bytesUrlObserveValue,
			strategy, null);
	BackgroundControlDecorationSupport.create(binding0, SWT.TOP | SWT.LEFT);

	//
	IObservableValue observeTextTextObserveWidget = WidgetProperties.text(SWT.Modify).observeDelayed(BTSUIConstants.DELAY, text);
	IObservableValue bytesUsernameObserveValue = PojoProperties.value("user").observe(connection);
	UpdateValueStrategy strategy_1 = new UpdateValueStrategy();
	strategy_1.setAfterGetValidator(new StringNotEmptyValidator());
	Binding binding1 = bindingContext.bindValue(observeTextTextObserveWidget, bytesUsernameObserveValue,
			strategy_1, null);
	BackgroundControlDecorationSupport.create(binding1, SWT.TOP | SWT.LEFT);

	//
	IObservableValue observeTextText_1ObserveWidget = WidgetProperties.text(SWT.Modify).observeDelayed(BTSUIConstants.DELAY,
			text_1);
	IObservableValue bytesPasswordObserveValue = PojoProperties.value("password").observe(connection);
	UpdateValueStrategy strategy_2 = new UpdateValueStrategy();
	strategy_2.setAfterGetValidator(new StringNotEmptyValidator());
	Binding binding2 = bindingContext.bindValue(observeTextText_1ObserveWidget, bytesPasswordObserveValue,
			strategy_2, null);
	BackgroundControlDecorationSupport.create(binding2, SWT.TOP | SWT.LEFT);

	//
	uiElement = WidgetProperties.text().observe(errorLabelServer);  
	// This one listenes to all changes
	bindingContext.bindValue(uiElement, new AggregateValidationStatus(bindingContext.getBindings(),
			AggregateValidationStatus.MAX_SEVERITY), null, null);
	// Lets change the color of the field lastName
	uiElement.addChangeListener(new IChangeListener()
	{
		@Override
		public void handleChange(ChangeEvent event)
		{
			boolean allcomplete = true;
			for (Object o : bindingContext.getBindings())
			{
				Binding binding = (Binding) o;
				IStatus status = (IStatus) binding.getValidationStatus().getValue();
				Control control = null;
				if (binding.getTarget() instanceof SWTVetoableValueDecorator)
				{
					SWTVetoableValueDecorator deco = (SWTVetoableValueDecorator) binding.getTarget();
					control = (Control) deco.getWidget();
					setWidgetBackground(control, status);

				}
				if (!status.isOK())
				{
					allcomplete = false;
				}
			}
			setPageComplete(allcomplete);

		}
	});
	return bindingContext;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:68,代码来源:ConnectToServerPage.java

示例12: handleChange

import org.eclipse.core.databinding.observable.ChangeEvent; //导入依赖的package包/类
public void handleChange(ChangeEvent event) {
	pchangesuport.firePropertyChange("dirty", false, true);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:4,代码来源:ADataAdapterComposite.java

示例13: handleChange

import org.eclipse.core.databinding.observable.ChangeEvent; //导入依赖的package包/类
@Override
public void handleChange(ChangeEvent event) {
	if (run) {
		handleValidationStatusChange(event);			
	}
}
 
开发者ID:Cooperate-Project,项目名称:CooperateModelingEnvironment,代码行数:7,代码来源:ValidationProcessor.java

示例14: handleChange

import org.eclipse.core.databinding.observable.ChangeEvent; //导入依赖的package包/类
@Override
public void handleChange(ChangeEvent event) {
	splevoProjectEditor.markAsDirty();
}
 
开发者ID:kopl,项目名称:SPLevo,代码行数:5,代码来源:MarkDirtyListener.java

示例15: handleChange

import org.eclipse.core.databinding.observable.ChangeEvent; //导入依赖的package包/类
@Override
public void handleChange(ChangeEvent event) {
  dirty = true;
}
 
开发者ID:agusevas,项目名称:logan,代码行数:5,代码来源:AddExpressionDialog.java


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