diff options
Diffstat (limited to 'plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/databinding/CompletionStyledTextReferenceDialogObservableValue.java')
-rw-r--r-- | plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/databinding/CompletionStyledTextReferenceDialogObservableValue.java | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/databinding/CompletionStyledTextReferenceDialogObservableValue.java b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/databinding/CompletionStyledTextReferenceDialogObservableValue.java new file mode 100644 index 00000000000..ef22a7ba233 --- /dev/null +++ b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/databinding/CompletionStyledTextReferenceDialogObservableValue.java @@ -0,0 +1,68 @@ +/***************************************************************************** + * Copyright (c) 2015 CEA LIST and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.widgets.databinding; + +import org.eclipse.core.databinding.observable.value.IObservableValue; +import org.eclipse.papyrus.infra.widgets.editors.CompletionStyledTextReferenceDialog; +import org.eclipse.swt.custom.StyledText; + +/** + * @author VL222926 + * + */ +public class CompletionStyledTextReferenceDialogObservableValue extends CompletionStyledTextObservableValue { + + /** + * the styled text with completion reference dialog + */ + private CompletionStyledTextReferenceDialog referenceDialog; + + /** + * @param dialog + * The observed StyledTextReferenceDialog + * @param styledText + * The observed StyledText + * @param modelObservable + * The Model IObservable + * @param eventType + * The eventType to listen to. When the event is fired by the Text + * widget, this IObservableValue will fire a ChangeEvent + */ + public CompletionStyledTextReferenceDialogObservableValue(CompletionStyledTextReferenceDialog dialog, StyledText styledText, IObservableValue modelObservable, int eventType) { + super(styledText, modelObservable, eventType); + this.referenceDialog = dialog; + } + + /** + * + * @see org.eclipse.papyrus.infra.widgets.databinding.StyledTextObservableValue#doSetValue(java.lang.Object) + * + * @param value + */ + @Override + protected void doSetValue(Object value) { + super.doSetValue(value); + referenceDialog.update(); + } + + /** + * @see org.eclipse.papyrus.infra.widgets.databinding.CompletionStyledTextObservableValue#doGetValue() + * + * @return + */ + @Override + protected Object doGetValue() { + return super.doGetValue(); + } +} |