Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageSyncAppliedStereotypeEditPart.java')
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageSyncAppliedStereotypeEditPart.java229
1 files changed, 108 insertions, 121 deletions
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageSyncAppliedStereotypeEditPart.java b/incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageSyncAppliedStereotypeEditPart.java
index fb3e36e5c57..c599bc278db 100644
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageSyncAppliedStereotypeEditPart.java
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing/src/org/eclipse/papyrus/uml/diagram/timing/edit/parts/MessageSyncAppliedStereotypeEditPart.java
@@ -122,8 +122,7 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
* @generated
*/
static {
- registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.timing.edit.parts.MessageSyncAppliedStereotypeEditPart.VISUAL_ID),
- new Point(0, -30));
+ registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.timing.edit.parts.MessageSyncAppliedStereotypeEditPart.VISUAL_ID), new Point(0, -30));
}
/**
@@ -156,12 +155,12 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
* @generated
*/
protected String getLabelTextHelper(final IFigure figure) {
- if (figure instanceof WrappingLabel) {
- return ((WrappingLabel) figure).getText();
- } else if (figure instanceof ILabelFigure) {
- return ((ILabelFigure) figure).getText();
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getText();
+ } else if(figure instanceof ILabelFigure) {
+ return ((ILabelFigure)figure).getText();
} else {
- return ((Label) figure).getText();
+ return ((Label)figure).getText();
}
}
@@ -169,12 +168,12 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
* @generated
*/
protected void setLabelTextHelper(final IFigure figure, final String text) {
- if (figure instanceof WrappingLabel) {
- ((WrappingLabel) figure).setText(text);
- } else if (figure instanceof ILabelFigure) {
- ((ILabelFigure) figure).setText(text);
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setText(text);
+ } else if(figure instanceof ILabelFigure) {
+ ((ILabelFigure)figure).setText(text);
} else {
- ((Label) figure).setText(text);
+ ((Label)figure).setText(text);
}
}
@@ -182,12 +181,12 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
* @generated
*/
protected Image getLabelIconHelper(final IFigure figure) {
- if (figure instanceof WrappingLabel) {
- return ((WrappingLabel) figure).getIcon();
- } else if (figure instanceof ILabelFigure) {
- return ((ILabelFigure) figure).getIcon();
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getIcon();
+ } else if(figure instanceof ILabelFigure) {
+ return ((ILabelFigure)figure).getIcon();
} else {
- return ((Label) figure).getIcon();
+ return ((Label)figure).getIcon();
}
}
@@ -195,12 +194,12 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
* @generated
*/
protected void setLabelIconHelper(final IFigure figure, final Image icon) {
- if (figure instanceof WrappingLabel) {
- ((WrappingLabel) figure).setIcon(icon);
- } else if (figure instanceof ILabelFigure) {
- ((ILabelFigure) figure).setIcon(icon);
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setIcon(icon);
+ } else if(figure instanceof ILabelFigure) {
+ ((ILabelFigure)figure).setIcon(icon);
} else {
- ((Label) figure).setIcon(icon);
+ ((Label)figure).setIcon(icon);
}
}
@@ -251,10 +250,10 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
protected String getLabelText() {
String text = null;
final EObject parserElement = getParserElement();
- if (parserElement != null && getParser() != null) {
+ if(parserElement != null && getParser() != null) {
text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
}
- if (text == null || text.length() == 0) {
+ if(text == null || text.length() == 0) {
text = this.defaultText;
}
return text;
@@ -266,12 +265,12 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
public void setLabelText(final String text) {
setLabelTextHelper(getFigure(), text);
final Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
}
final Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
}
}
@@ -279,7 +278,7 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
* @generated
*/
public String getEditText() {
- if (getParserElement() == null || getParser() == null) {
+ if(getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
@@ -299,14 +298,14 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
return new ICellEditorValidator() {
public String isValid(final Object value) {
- if (value instanceof String) {
+ if(value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- final IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+ final IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -325,7 +324,7 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if (getParserElement() == null || getParser() == null) {
+ if(getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -342,9 +341,8 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
* @generated
*/
public IParser getParser() {
- if (this.parser == null) {
- this.parser = UMLParserProvider.getParser(UMLElementTypes.Message_3, getParserElement(),
- UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.timing.edit.parts.MessageSyncAppliedStereotypeEditPart.VISUAL_ID));
+ if(this.parser == null) {
+ this.parser = UMLParserProvider.getParser(UMLElementTypes.Message_3, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.timing.edit.parts.MessageSyncAppliedStereotypeEditPart.VISUAL_ID));
}
return this.parser;
}
@@ -353,9 +351,8 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
* @generated
*/
protected DirectEditManager getManager() {
- if (this.manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this),
- UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if(this.manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return this.manager;
}
@@ -378,8 +375,8 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
* @generated
*/
protected void performDirectEdit(final Point eventLocation) {
- if (getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
+ if(getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -387,8 +384,8 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
* @generated
*/
private void performDirectEdit(final char initialCharacter) {
- if (getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager) getManager()).show(initialCharacter);
+ if(getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager)getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -402,43 +399,40 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
final Request theRequest = request;
- if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == this.directEditionMode) {
+ if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == this.directEditionMode) {
this.directEditionMode = getDirectEditionType();
}
- switch (this.directEditionMode) {
+ switch(this.directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if (this.configuration == null || this.configuration.getLanguage() == null) {
+ if(this.configuration == null || this.configuration.getLanguage() == null) {
performDefaultDirectEditorEdit(theRequest);
} else {
this.configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if (this.configuration instanceof IPopupEditorConfiguration) {
- final IPopupEditorHelper helper = ((IPopupEditorConfiguration) this.configuration).createPopupEditorHelper(this);
+ if(this.configuration instanceof IPopupEditorConfiguration) {
+ final IPopupEditorHelper helper = ((IPopupEditorConfiguration)this.configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if (this.configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration) this.configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
- resolveSemanticElement(), this.configuration.getTextToEdit(resolveSemanticElement()));
- } else if (this.configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(),
- this.configuration.getTextToEdit(resolveSemanticElement()), this.configuration);
+ } else if(this.configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration)this.configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), this.configuration.getTextToEdit(resolveSemanticElement()));
+ } else if(this.configuration instanceof IDirectEditorConfiguration) {
+ dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), this.configuration.getTextToEdit(resolveSemanticElement()), this.configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if (Window.OK == dialog.open()) {
+ if(Window.OK == dialog.open()) {
final TransactionalEditingDomain domain = getEditingDomain();
final RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- MessageSyncAppliedStereotypeEditPart.this.configuration.postEditAction(resolveSemanticElement(),
- ((ILabelEditorDialog) finalDialog).getValue());
+ MessageSyncAppliedStereotypeEditPart.this.configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
}
};
@@ -453,13 +447,12 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
getEditingDomain().runExclusive(new Runnable() {
public void run() {
- if (isActive() && isEditable()) {
- if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- final Character initialChar = (Character) theRequest.getExtendedData().get(
- RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ final Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- final DirectEditRequest editRequest = (DirectEditRequest) theRequest;
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ final DirectEditRequest editRequest = (DirectEditRequest)theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -494,17 +487,17 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
*/
protected void refreshLabel() {
final EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if (maskLabelPolicy == null) {
+ if(maskLabelPolicy == null) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
}
final Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
}
final Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
}
}
@@ -512,15 +505,15 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
* @generated
*/
protected void refreshUnderline() {
- final FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if (style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ final FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
}
- if (resolveSemanticElement() instanceof Feature) {
- if (((Feature) resolveSemanticElement()).isStatic()) {
- ((WrappingLabel) getFigure()).setTextUnderline(true);
+ if(resolveSemanticElement() instanceof Feature) {
+ if(((Feature)resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel)getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel) getFigure()).setTextUnderline(false);
+ ((WrappingLabel)getFigure()).setTextUnderline(false);
}
}
}
@@ -529,9 +522,9 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
* @generated
*/
protected void refreshStrikeThrough() {
- final FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if (style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ final FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -540,10 +533,9 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
*/
@Override
protected void refreshFont() {
- final FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if (style != null) {
- final FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL)
- | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ final FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null) {
+ final FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -561,11 +553,11 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
*/
@Override
protected void addSemanticListeners() {
- if (getParser() instanceof ISemanticParser) {
+ if(getParser() instanceof ISemanticParser) {
final EObject element = resolveSemanticElement();
- this.parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
- for (int i = 0; i < this.parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject) this.parserElements.get(i)); //$NON-NLS-1$
+ this.parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
+ for(int i = 0; i < this.parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject)this.parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -577,8 +569,8 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
*/
@Override
protected void removeSemanticListeners() {
- if (this.parserElements != null) {
- for (int i = 0; i < this.parserElements.size(); i++) {
+ if(this.parserElements != null) {
+ for(int i = 0; i < this.parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -591,7 +583,7 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
*/
@Override
protected AccessibleEditPart getAccessibleEditPart() {
- if (this.accessibleEP == null) {
+ if(this.accessibleEP == null) {
this.accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -607,7 +599,7 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
* @generated
*/
private View getFontStyleOwnerView() {
- return (View) getModel();
+ return (View)getModel();
}
/**
@@ -618,11 +610,11 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
* @generated
*/
public int getDirectEditionType() {
- if (checkExtendedEditor()) {
+ if(checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if (checkDefaultEdition()) {
+ if(checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
@@ -637,7 +629,7 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
* @generated
*/
protected boolean checkExtendedEditor() {
- if (resolveSemanticElement() != null) {
+ if(resolveSemanticElement() != null) {
return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
}
return false;
@@ -659,14 +651,12 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if (this.configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore()
- .getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if (languagePreferred != null && !languagePreferred.equals("")) {
+ if(this.configuration == null) {
+ final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("")) {
this.configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
} else {
- this.configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass()
- .getInstanceClassName());
+ this.configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
}
}
}
@@ -677,11 +667,10 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- final String languagePreferred = Activator.getDefault().getPreferenceStore()
- .getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if (languagePreferred != null && !languagePreferred.equals("") && languagePreferred != this.configuration.getLanguage()) {
+ final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("") && languagePreferred != this.configuration.getLanguage()) {
this.configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
this.configuration = null;
}
}
@@ -690,7 +679,7 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
* Performs the direct edit usually used by GMF editors.
*
* @param theRequest
- * the direct edit request that starts the direct edit system
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -699,13 +688,12 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
getEditingDomain().runExclusive(new Runnable() {
public void run() {
- if (isActive() && isEditable()) {
- if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- final Character initialChar = (Character) theRequest.getExtendedData().get(
- RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ final Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- final DirectEditRequest editRequest = (DirectEditRequest) theRequest;
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ final DirectEditRequest editRequest = (DirectEditRequest)theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -724,25 +712,24 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
@Override
protected void handleNotificationEvent(final Notification event) {
final Object feature = event.getFeature();
- if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- final Integer c = (Integer) event.getNewValue();
+ if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ final Integer c = (Integer)event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature)
- || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if (getParser() instanceof ISemanticParser) {
- final ISemanticParser modelParser = (ISemanticParser) getParser();
- if (modelParser.areSemanticElementsAffected(null, event)) {
+ if(getParser() instanceof ISemanticParser) {
+ final ISemanticParser modelParser = (ISemanticParser)getParser();
+ if(modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if (resolveSemanticElement() != null) {
+ if(resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();

Back to the top