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/SlotEditPart.java')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src-gen/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/SlotEditPart.java134
1 files changed, 54 insertions, 80 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src-gen/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/SlotEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src-gen/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/SlotEditPart.java
index fa5cd263ea7..11e4113a92b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src-gen/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/SlotEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src-gen/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/SlotEditPart.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;
@@ -89,7 +89,8 @@ import org.eclipse.uml2.uml.UMLPackage;
/**
* @generated
*/
-public class SlotEditPart extends UMLCompartmentEditPart
+public class SlotEditPart extends
+ UMLCompartmentEditPart
implements ITextAwareEditPart, IPrimaryEditPart, IControlParserForDirectEdit {
/**
@@ -131,6 +132,7 @@ public class SlotEditPart extends UMLCompartmentEditPart
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -141,7 +143,6 @@ public class SlotEditPart extends UMLCompartmentEditPart
/**
* @generated
*/
- @Override
public DragTracker getDragTracker(Request request) {
if (request instanceof SelectionRequest && ((SelectionRequest) request).getLastButtonPressed() == 3) {
return null;
@@ -152,7 +153,6 @@ public class SlotEditPart extends UMLCompartmentEditPart
/**
* @generated
*/
- @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
@@ -162,6 +162,7 @@ public class SlotEditPart extends UMLCompartmentEditPart
installEditPolicy(SlotDisplayEditPolicy.SLOT_DISPLAY, new SlotDisplayEditPolicy());
}
+
/**
* @generated
*/
@@ -228,7 +229,6 @@ public class SlotEditPart extends UMLCompartmentEditPart
/**
* @generated
*/
- @Override
protected List<?> getModelChildren() {
return Collections.EMPTY_LIST;
}
@@ -236,7 +236,6 @@ public class SlotEditPart extends UMLCompartmentEditPart
/**
* @generated
*/
- @Override
public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
return null;
}
@@ -244,7 +243,6 @@ public class SlotEditPart extends UMLCompartmentEditPart
/**
* @generated
*/
- @Override
public void setParser(IParser parser) {
this.parser = parser;
}
@@ -270,7 +268,8 @@ public class SlotEditPart 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) {
@@ -282,7 +281,6 @@ public class SlotEditPart extends UMLCompartmentEditPart
/**
* @generated
*/
- @Override
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
@@ -298,12 +296,12 @@ public class SlotEditPart 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());
}
@@ -317,7 +315,6 @@ public class SlotEditPart extends UMLCompartmentEditPart
/**
* @generated
*/
- @Override
public ICellEditorValidator getEditTextValidator() {
return new ICellEditorValidator() {
@@ -327,14 +324,12 @@ public class SlotEditPart 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(), SlotEditPart.this),
- (String) value));
+ setResult(parser.isValidEditString(ParserUtil.getParserAdapter(getParserElement(), SlotEditPart.this), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -352,7 +347,6 @@ public class SlotEditPart extends UMLCompartmentEditPart
/**
* @generated
*/
- @Override
public IContentAssistProcessor getCompletionProcessor() {
if (getParserElement() == null || getParser() == null) {
return null;
@@ -363,7 +357,6 @@ public class SlotEditPart extends UMLCompartmentEditPart
/**
* @generated
*/
- @Override
public ParserOptions getParserOptions() {
return ParserOptions.NONE;
}
@@ -371,7 +364,6 @@ public class SlotEditPart extends UMLCompartmentEditPart
/**
* @generated
*/
- @Override
public IParser getParser() {
if (parser == null) {
parser = ParserUtil.getParser(UMLElementTypes.Slot_SlotLabel, getParserElement(), this, VISUAL_ID);
@@ -434,7 +426,6 @@ public class SlotEditPart extends UMLCompartmentEditPart
/**
* @generated
*/
- @Override
protected void performDirectEditRequest(Request request) {
final Request theRequest = request;
@@ -462,18 +453,13 @@ public class SlotEditPart 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;
}
@@ -485,8 +471,7 @@ public class SlotEditPart extends UMLCompartmentEditPart
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(),
- ((ILabelEditorDialog) finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
}
};
@@ -512,10 +497,9 @@ public class SlotEditPart 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();
@@ -531,7 +515,6 @@ public class SlotEditPart extends UMLCompartmentEditPart
/**
* @generated
*/
- @Override
protected void refreshVisuals() {
super.refreshVisuals();
refreshLabel();
@@ -573,7 +556,8 @@ public class SlotEditPart 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());
}
@@ -590,7 +574,8 @@ public class SlotEditPart 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());
}
@@ -599,12 +584,14 @@ public class SlotEditPart 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);
}
}
@@ -612,7 +599,6 @@ public class SlotEditPart extends UMLCompartmentEditPart
/**
* @generated
*/
- @Override
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -620,7 +606,6 @@ public class SlotEditPart extends UMLCompartmentEditPart
/**
* @generated
*/
- @Override
protected void addSemanticListeners() {
if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
@@ -636,7 +621,6 @@ public class SlotEditPart extends UMLCompartmentEditPart
/**
* @generated
*/
- @Override
protected void removeSemanticListeners() {
if (parserElements != null) {
for (int i = 0; i < parserElements.size(); i++) {
@@ -650,7 +634,6 @@ public class SlotEditPart extends UMLCompartmentEditPart
/**
* @generated
*/
- @Override
protected AccessibleEditPart getAccessibleEditPart() {
if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@@ -673,7 +656,7 @@ public class SlotEditPart 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
*/
@@ -692,7 +675,7 @@ public class SlotEditPart extends UMLCompartmentEditPart
/**
* Checks if an extended editor is present.
- *
+ *
* @return <code>true</code> if an extended editor is present.
* @generated
*/
@@ -705,7 +688,7 @@ public class SlotEditPart extends UMLCompartmentEditPart
/**
* Checks if a default direct edition is available
- *
+ *
* @return <code>true</code> if a default direct edition is available
* @generated
*/
@@ -720,14 +703,11 @@ public class SlotEditPart 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);
}
}
}
@@ -740,10 +720,8 @@ public class SlotEditPart 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;
}
@@ -764,13 +742,11 @@ public class SlotEditPart 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 {
@@ -784,10 +760,10 @@ public class SlotEditPart extends UMLCompartmentEditPart
}
}
+
/**
* @generated
*/
- @Override
protected void addNotationalListeners() {
super.addNotationalListeners();
addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
@@ -796,7 +772,6 @@ public class SlotEditPart extends UMLCompartmentEditPart
/**
* @generated
*/
- @Override
protected void removeNotationalListeners() {
super.removeNotationalListeners();
removeListenerFilter("PrimaryView"); //$NON-NLS-1$
@@ -805,7 +780,6 @@ public class SlotEditPart extends UMLCompartmentEditPart
/**
* @generated
*/
- @Override
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
@@ -815,10 +789,10 @@ public class SlotEditPart 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())) {
@@ -844,7 +818,6 @@ public class SlotEditPart extends UMLCompartmentEditPart
/**
* @generated
*/
- @Override
protected IFigure createFigure() {
IFigure label = createFigurePrim();
defaultText = getLabelTextHelper(label);
@@ -865,4 +838,5 @@ public class SlotEditPart extends UMLCompartmentEditPart
public boolean isSelectable() {
return getFigure().isShowing();
}
+
}

Back to the top