本文整理汇总了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);
}
示例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);
}
示例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 );
}
} );
}
示例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);
}
}
});
}
示例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;
}
示例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());
}
}
示例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);
}
}
示例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();
}
});
}
示例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);
}
}
示例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;
}
示例12: handleChange
import org.eclipse.core.databinding.observable.ChangeEvent; //导入依赖的package包/类
public void handleChange(ChangeEvent event) {
pchangesuport.firePropertyChange("dirty", false, true);
}
示例13: handleChange
import org.eclipse.core.databinding.observable.ChangeEvent; //导入依赖的package包/类
@Override
public void handleChange(ChangeEvent event) {
if (run) {
handleValidationStatusChange(event);
}
}
示例14: handleChange
import org.eclipse.core.databinding.observable.ChangeEvent; //导入依赖的package包/类
@Override
public void handleChange(ChangeEvent event) {
splevoProjectEditor.markAsDirty();
}
示例15: handleChange
import org.eclipse.core.databinding.observable.ChangeEvent; //导入依赖的package包/类
@Override
public void handleChange(ChangeEvent event) {
dirty = true;
}