Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src-gen/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/NestedInterfaceForInterfaceEditPart.java')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src-gen/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/NestedInterfaceForInterfaceEditPart.java148
1 files changed, 58 insertions, 90 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src-gen/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/NestedInterfaceForInterfaceEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src-gen/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/NestedInterfaceForInterfaceEditPart.java
index c02a2719201..dab2980641c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src-gen/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/NestedInterfaceForInterfaceEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src-gen/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/NestedInterfaceForInterfaceEditPart.java
@@ -1,13 +1,13 @@
/**
* Copyright (c) 2014 CEA LIST.
- *
- * 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
+ *
+ * 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.uml.diagram.clazz.edit.parts;
@@ -95,7 +95,8 @@ import org.eclipse.uml2.uml.UMLPackage;
/**
* @generated
*/
-public class NestedInterfaceForInterfaceEditPart extends UMLCompartmentEditPart
+public class NestedInterfaceForInterfaceEditPart extends
+ UMLCompartmentEditPart
implements ITextAwareEditPart, IPrimaryEditPart, IControlParserForDirectEdit {
/**
@@ -137,6 +138,7 @@ public class NestedInterfaceForInterfaceEditPart extends UMLCompartmentEditPart
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -147,7 +149,6 @@ public class NestedInterfaceForInterfaceEditPart extends UMLCompartmentEditPart
/**
* @generated
*/
- @Override
public DragTracker getDragTracker(Request request) {
if (request instanceof SelectionRequest && ((SelectionRequest) request).getLastButtonPressed() == 3) {
return null;
@@ -158,19 +159,17 @@ public class NestedInterfaceForInterfaceEditPart extends UMLCompartmentEditPart
/**
* @generated
*/
- @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new UMLTextNonResizableEditPolicy());
installEditPolicy(EditPolicy.COMPONENT_ROLE, new ListItemComponentEditPolicy());
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(AbstractAppliedStereotypeDisplayEditPolicy.STEREOTYPE_LABEL_POLICY,
- new AppliedStereotypeNestedLabelDisplayEditPolicy());
- installEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY,
- new NestedLabelMaskManagedEditPolicy());
+ installEditPolicy(AbstractAppliedStereotypeDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNestedLabelDisplayEditPolicy());
+ installEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY, new NestedLabelMaskManagedEditPolicy());
}
+
/**
* @generated
*/
@@ -237,7 +236,6 @@ public class NestedInterfaceForInterfaceEditPart extends UMLCompartmentEditPart
/**
* @generated
*/
- @Override
protected List<?> getModelChildren() {
return Collections.EMPTY_LIST;
}
@@ -245,7 +243,6 @@ public class NestedInterfaceForInterfaceEditPart extends UMLCompartmentEditPart
/**
* @generated
*/
- @Override
public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
return null;
}
@@ -253,7 +250,6 @@ public class NestedInterfaceForInterfaceEditPart extends UMLCompartmentEditPart
/**
* @generated
*/
- @Override
public void setParser(IParser parser) {
this.parser = parser;
}
@@ -289,7 +285,8 @@ public class NestedInterfaceForInterfaceEditPart extends UMLCompartmentEditPart
String text = null;
EObject parserElement = getParserElement();
if (parserElement != null && getParser() != null) {
- text = getParser().getPrintString(ParserUtil.getParserAdapter(getParserElement(), this),
+ text = getParser().getPrintString(
+ ParserUtil.getParserAdapter(getParserElement(), this),
getParserOptions().intValue());
}
if (text == null || text.length() == 0) {
@@ -301,7 +298,6 @@ public class NestedInterfaceForInterfaceEditPart extends UMLCompartmentEditPart
/**
* @generated
*/
- @Override
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
@@ -317,12 +313,12 @@ public class NestedInterfaceForInterfaceEditPart extends UMLCompartmentEditPart
/**
* @generated
*/
- @Override
public String getEditText() {
if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(ParserUtil.getParserAdapter(getParserElement(), this),
+ return getParser().getEditString(
+ ParserUtil.getParserAdapter(getParserElement(), this),
getParserOptions().intValue());
}
@@ -336,7 +332,6 @@ public class NestedInterfaceForInterfaceEditPart extends UMLCompartmentEditPart
/**
* @generated
*/
- @Override
public ICellEditorValidator getEditTextValidator() {
return new ICellEditorValidator() {
@@ -346,16 +341,12 @@ public class NestedInterfaceForInterfaceEditPart extends UMLCompartmentEditPart
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
- .runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(
- parser.isValidEditString(
- ParserUtil.getParserAdapter(getParserElement(),
- NestedInterfaceForInterfaceEditPart.this),
- (String) value));
+ setResult(parser.isValidEditString(ParserUtil.getParserAdapter(getParserElement(), NestedInterfaceForInterfaceEditPart.this), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -373,7 +364,6 @@ public class NestedInterfaceForInterfaceEditPart extends UMLCompartmentEditPart
/**
* @generated
*/
- @Override
public IContentAssistProcessor getCompletionProcessor() {
if (getParserElement() == null || getParser() == null) {
return null;
@@ -384,7 +374,6 @@ public class NestedInterfaceForInterfaceEditPart extends UMLCompartmentEditPart
/**
* @generated
*/
- @Override
public ParserOptions getParserOptions() {
return ParserOptions.NONE;
}
@@ -392,11 +381,9 @@ public class NestedInterfaceForInterfaceEditPart extends UMLCompartmentEditPart
/**
* @generated
*/
- @Override
public IParser getParser() {
if (parser == null) {
- parser = ParserUtil.getParser(UMLElementTypes.Interface_InterfaceNestedClassifierLabel, getParserElement(),
- this, VISUAL_ID);
+ parser = ParserUtil.getParser(UMLElementTypes.Interface_InterfaceNestedClassifierLabel, getParserElement(), this, VISUAL_ID);
}
return parser;
}
@@ -456,7 +443,6 @@ public class NestedInterfaceForInterfaceEditPart extends UMLCompartmentEditPart
/**
* @generated
*/
- @Override
protected void performDirectEditRequest(Request request) {
final Request theRequest = request;
@@ -484,18 +470,13 @@ public class NestedInterfaceForInterfaceEditPart extends UMLCompartmentEditPart
initializeDirectEditManager(theRequest);
return;
} else if (configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration)
- .createPopupEditorHelper(this);
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
} else if (configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(),
- configuration.getTextToEdit(resolveSemanticElement()));
+ 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);
+ dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
@@ -507,8 +488,7 @@ public class NestedInterfaceForInterfaceEditPart extends UMLCompartmentEditPart
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(),
- ((ILabelEditorDialog) finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
}
};
@@ -534,10 +514,9 @@ public class NestedInterfaceForInterfaceEditPart extends UMLCompartmentEditPart
@Override
public void run() {
if (isActive() && isEditable()) {
- if (request.getExtendedData()
- .get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character) request.getExtendedData()
- .get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -553,7 +532,6 @@ public class NestedInterfaceForInterfaceEditPart extends UMLCompartmentEditPart
/**
* @generated
*/
- @Override
protected void refreshVisuals() {
super.refreshVisuals();
refreshLabel();
@@ -595,7 +573,8 @@ public class NestedInterfaceForInterfaceEditPart extends UMLCompartmentEditPart
* @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());
}
@@ -612,7 +591,8 @@ public class NestedInterfaceForInterfaceEditPart extends UMLCompartmentEditPart
* @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());
}
@@ -621,12 +601,14 @@ public class NestedInterfaceForInterfaceEditPart extends UMLCompartmentEditPart
/**
* @generated
*/
- @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(),
- (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) |
+ (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -634,7 +616,6 @@ public class NestedInterfaceForInterfaceEditPart extends UMLCompartmentEditPart
/**
* @generated
*/
- @Override
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -642,7 +623,6 @@ public class NestedInterfaceForInterfaceEditPart extends UMLCompartmentEditPart
/**
* @generated
*/
- @Override
protected void addSemanticListeners() {
if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
@@ -658,7 +638,6 @@ public class NestedInterfaceForInterfaceEditPart extends UMLCompartmentEditPart
/**
* @generated
*/
- @Override
protected void removeSemanticListeners() {
if (parserElements != null) {
for (int i = 0; i < parserElements.size(); i++) {
@@ -672,7 +651,6 @@ public class NestedInterfaceForInterfaceEditPart extends UMLCompartmentEditPart
/**
* @generated
*/
- @Override
protected AccessibleEditPart getAccessibleEditPart() {
if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@@ -695,7 +673,7 @@ public class NestedInterfaceForInterfaceEditPart extends UMLCompartmentEditPart
/**
* Returns the kind of associated editor for direct edition.
- *
+ *
* @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
* @generated
*/
@@ -714,7 +692,7 @@ public class NestedInterfaceForInterfaceEditPart extends UMLCompartmentEditPart
/**
* Checks if an extended editor is present.
- *
+ *
* @return <code>true</code> if an extended editor is present.
* @generated
*/
@@ -727,7 +705,7 @@ public class NestedInterfaceForInterfaceEditPart extends UMLCompartmentEditPart
/**
* Checks if a default direct edition is available
- *
+ *
* @return <code>true</code> if a default direct edition is available
* @generated
*/
@@ -742,14 +720,11 @@ public class NestedInterfaceForInterfaceEditPart extends UMLCompartmentEditPart
*/
protected void initExtendedEditorConfiguration() {
if (configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
- IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
if (languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(),
- this);
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE,
- resolveSemanticElement(), this);
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
@@ -762,10 +737,8 @@ public class NestedInterfaceForInterfaceEditPart extends UMLCompartmentEditPart
protected void updateExtendedEditorConfiguration() {
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(),
- this);
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
@@ -786,13 +759,11 @@ public class NestedInterfaceForInterfaceEditPart extends UMLCompartmentEditPart
@Override
public void run() {
if (isActive() && isEditable()) {
- if (theRequest.getExtendedData()
- .get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character) theRequest.getExtendedData()
- .get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if ((theRequest instanceof DirectEditRequest)
- && (getEditText().equals(getLabelText()))) {
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
@@ -806,10 +777,10 @@ public class NestedInterfaceForInterfaceEditPart extends UMLCompartmentEditPart
}
}
+
/**
* @generated
*/
- @Override
protected void addNotationalListeners() {
super.addNotationalListeners();
addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
@@ -818,7 +789,6 @@ public class NestedInterfaceForInterfaceEditPart extends UMLCompartmentEditPart
/**
* @generated
*/
- @Override
protected void removeNotationalListeners() {
super.removeNotationalListeners();
removeListenerFilter("PrimaryView"); //$NON-NLS-1$
@@ -827,7 +797,6 @@ public class NestedInterfaceForInterfaceEditPart extends UMLCompartmentEditPart
/**
* @generated
*/
- @Override
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
@@ -837,10 +806,10 @@ public class NestedInterfaceForInterfaceEditPart extends UMLCompartmentEditPart
refreshUnderline();
} 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())) {
@@ -857,8 +826,7 @@ public class NestedInterfaceForInterfaceEditPart extends UMLCompartmentEditPart
}
}
}
- if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON
- .equals(((EAnnotation) event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
if (UMLPackage.eINSTANCE.getFeature_IsStatic().equals(feature)) {
@@ -870,7 +838,6 @@ public class NestedInterfaceForInterfaceEditPart extends UMLCompartmentEditPart
/**
* @generated
*/
- @Override
protected IFigure createFigure() {
IFigure label = createFigurePrim();
defaultText = getLabelTextHelper(label);
@@ -891,4 +858,5 @@ public class NestedInterfaceForInterfaceEditPart extends UMLCompartmentEditPart
public boolean isSelectable() {
return getFigure().isShowing();
}
+
}

Back to the top