Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/AppliedStereotypeUsageEditPart.java')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/AppliedStereotypeUsageEditPart.java57
1 files changed, 24 insertions, 33 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/AppliedStereotypeUsageEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/AppliedStereotypeUsageEditPart.java
index 07cf7cd79a1..0dc8b14894a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/AppliedStereotypeUsageEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/AppliedStereotypeUsageEditPart.java
@@ -123,6 +123,7 @@ public class AppliedStereotypeUsageEditPart extends PapyrusLabelEditPart impleme
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -211,8 +212,7 @@ public class AppliedStereotypeUsageEditPart extends PapyrusLabelEditPart impleme
/**
* @generated
*/
- public void setLabel(IFigure
- figure) {
+ public void setLabel(IFigure figure) {
unregisterVisuals();
setFigure(figure);
defaultText = getLabelTextHelper(figure);
@@ -324,15 +324,14 @@ public class AppliedStereotypeUsageEditPart extends PapyrusLabelEditPart impleme
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid =
- (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
@@ -461,8 +460,7 @@ public class AppliedStereotypeUsageEditPart extends PapyrusLabelEditPart impleme
IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- }
- else if (configuration instanceof IAdvancedEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
} else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
@@ -507,8 +505,7 @@ public class AppliedStereotypeUsageEditPart extends PapyrusLabelEditPart impleme
RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- }
- else {
+ } else {
performDirectEdit();
}
}
@@ -558,17 +555,15 @@ public class AppliedStereotypeUsageEditPart extends PapyrusLabelEditPart impleme
* @generated
*/
protected void refreshUnderline() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ 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);
- }
- else {
+ } else {
((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
@@ -578,9 +573,8 @@ public class AppliedStereotypeUsageEditPart extends PapyrusLabelEditPart impleme
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
@@ -591,9 +585,8 @@ public class AppliedStereotypeUsageEditPart extends PapyrusLabelEditPart impleme
*/
@Override
protected void refreshFont() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null) {
FontData fontData = new FontData(
style.getFontName(), style.getFontHeight(),
@@ -684,7 +677,7 @@ public class AppliedStereotypeUsageEditPart extends PapyrusLabelEditPart impleme
*/
protected boolean checkExtendedEditor() {
if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -708,9 +701,9 @@ public class AppliedStereotypeUsageEditPart extends PapyrusLabelEditPart impleme
if (configuration == null) {
final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
if (languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
@@ -724,8 +717,7 @@ public class AppliedStereotypeUsageEditPart extends PapyrusLabelEditPart impleme
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement()
- .eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
@@ -787,8 +779,7 @@ public class AppliedStereotypeUsageEditPart extends PapyrusLabelEditPart impleme
refreshLabel();
}
if (getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser =
- (ISemanticParser) getParser();
+ ISemanticParser modelParser = (ISemanticParser) getParser();
if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
if (resolveSemanticElement() != null) {

Back to the top