diff options
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src-gen/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/ReceptionInInterfaceEditPart.java')
-rwxr-xr-x | plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src-gen/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/ReceptionInInterfaceEditPart.java | 152 |
1 files changed, 83 insertions, 69 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src-gen/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/ReceptionInInterfaceEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src-gen/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/ReceptionInInterfaceEditPart.java index 1b634f31bd0..e74ef309a03 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src-gen/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/ReceptionInInterfaceEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src-gen/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/ReceptionInInterfaceEditPart.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 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Contributors: * CEA LIST - Initial API and implementation */ @@ -55,6 +55,12 @@ import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.text.contentassist.IContentAssistProcessor; import org.eclipse.jface.viewers.ICellEditorValidator; import org.eclipse.jface.window.Window; +import org.eclipse.papyrus.infra.emf.appearance.helper.VisualInformationPapyrusConstants; +import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IControlParserForDirectEdit; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.parsers.ParserUtil; import org.eclipse.papyrus.infra.gmfdiag.extensionpoints.editors.Activator; import org.eclipse.papyrus.infra.gmfdiag.extensionpoints.editors.configuration.IAdvancedEditorConfiguration; import org.eclipse.papyrus.infra.gmfdiag.extensionpoints.editors.configuration.ICustomDirectEditorConfiguration; @@ -65,13 +71,6 @@ import org.eclipse.papyrus.infra.gmfdiag.extensionpoints.editors.ui.ILabelEditor import org.eclipse.papyrus.infra.gmfdiag.extensionpoints.editors.ui.IPopupEditorHelper; import org.eclipse.papyrus.infra.gmfdiag.extensionpoints.editors.utils.DirectEditorsUtil; import org.eclipse.papyrus.infra.gmfdiag.extensionpoints.editors.utils.IDirectEditorsIds; -import org.eclipse.papyrus.infra.emf.appearance.helper.AppearanceHelper; -import org.eclipse.papyrus.infra.emf.appearance.helper.VisualInformationPapyrusConstants; -import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IControlParserForDirectEdit; -import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy; -import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy; -import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy; -import org.eclipse.papyrus.infra.gmfdiag.common.parsers.ParserUtil; import org.eclipse.papyrus.uml.diagram.clazz.custom.figure.ReceptionFigure; import org.eclipse.papyrus.uml.diagram.clazz.edit.policies.UMLTextNonResizableEditPolicy; import org.eclipse.papyrus.uml.diagram.clazz.edit.policies.UMLTextSelectionEditPolicy; @@ -79,7 +78,6 @@ import org.eclipse.papyrus.uml.diagram.clazz.providers.UMLElementTypes; import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager; import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition; import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure; -import org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil; import org.eclipse.swt.SWT; import org.eclipse.swt.accessibility.AccessibleEvent; import org.eclipse.swt.custom.BusyIndicator; @@ -124,12 +122,14 @@ public class ReceptionInInterfaceEditPart extends CompartmentEditPart /** * direct edition mode (default, undefined, registered editor, etc.) + * * @generated */ protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR; /** * configuration from a registered edit dialog + * * @generated */ protected IDirectEditorConfiguration configuration; @@ -144,6 +144,7 @@ public class ReceptionInInterfaceEditPart extends CompartmentEditPart /** * @generated */ + @Override public DragTracker getDragTracker(Request request) { if (request instanceof SelectionRequest && ((SelectionRequest) request).getLastButtonPressed() == 3) { return null; @@ -154,6 +155,7 @@ public class ReceptionInInterfaceEditPart extends CompartmentEditPart /** * @generated */ + @Override protected void createDefaultEditPolicies() { super.createDefaultEditPolicies(); installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy()); @@ -228,6 +230,7 @@ public class ReceptionInInterfaceEditPart extends CompartmentEditPart /** * @generated */ + @Override protected List<?> getModelChildren() { return Collections.EMPTY_LIST; } @@ -235,6 +238,7 @@ public class ReceptionInInterfaceEditPart extends CompartmentEditPart /** * @generated */ + @Override public IGraphicalEditPart getChildBySemanticHint(String semanticHint) { return null; } @@ -242,6 +246,7 @@ public class ReceptionInInterfaceEditPart extends CompartmentEditPart /** * @generated */ + @Override public void setParser(IParser parser) { this.parser = parser; } @@ -257,8 +262,7 @@ public class ReceptionInInterfaceEditPart extends CompartmentEditPart * @generated */ protected Image getLabelIcon() { - return org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramEditPartsUtil.getIcon(getParserElement(), - getViewer()); + return org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramEditPartsUtil.getIcon(getParserElement(), getViewer()); } /** @@ -268,7 +272,8 @@ public class ReceptionInInterfaceEditPart extends CompartmentEditPart 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) { @@ -280,6 +285,7 @@ public class ReceptionInInterfaceEditPart extends CompartmentEditPart /** * @generated */ + @Override public void setLabelText(String text) { setLabelTextHelper(getFigure(), text); Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); @@ -295,11 +301,13 @@ public class ReceptionInInterfaceEditPart extends CompartmentEditPart /** * @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()); } @@ -313,6 +321,7 @@ public class ReceptionInInterfaceEditPart extends CompartmentEditPart /** * @generated */ + @Override public ICellEditorValidator getEditTextValidator() { return new ICellEditorValidator() { @@ -322,14 +331,12 @@ public class ReceptionInInterfaceEditPart extends CompartmentEditPart 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(), - ReceptionInInterfaceEditPart.this), (String) value)); + setResult(parser.isValidEditString(ParserUtil.getParserAdapter(getParserElement(), ReceptionInInterfaceEditPart.this), (String) value)); } }); return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage(); @@ -347,6 +354,7 @@ public class ReceptionInInterfaceEditPart extends CompartmentEditPart /** * @generated */ + @Override public IContentAssistProcessor getCompletionProcessor() { if (getParserElement() == null || getParser() == null) { return null; @@ -357,6 +365,7 @@ public class ReceptionInInterfaceEditPart extends CompartmentEditPart /** * @generated */ + @Override public ParserOptions getParserOptions() { return ParserOptions.NONE; } @@ -364,10 +373,10 @@ public class ReceptionInInterfaceEditPart extends CompartmentEditPart /** * @generated */ + @Override public IParser getParser() { if (parser == null) { - parser = ParserUtil.getParser(UMLElementTypes.Reception_InterfaceReceptionLabel, getParserElement(), this, - VISUAL_ID); + parser = ParserUtil.getParser(UMLElementTypes.Reception_InterfaceReceptionLabel, getParserElement(), this, VISUAL_ID); } return parser; } @@ -427,6 +436,7 @@ public class ReceptionInInterfaceEditPart extends CompartmentEditPart /** * @generated */ + @Override protected void performDirectEditRequest(Request request) { final Request theRequest = request; @@ -454,18 +464,13 @@ public class ReceptionInInterfaceEditPart extends CompartmentEditPart 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; } @@ -477,8 +482,7 @@ public class ReceptionInInterfaceEditPart extends CompartmentEditPart @Override protected void doExecute() { - configuration.postEditAction(resolveSemanticElement(), - ((ILabelEditorDialog) finalDialog).getValue()); + configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue()); } }; @@ -504,10 +508,9 @@ public class ReceptionInInterfaceEditPart extends CompartmentEditPart @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(); @@ -523,6 +526,7 @@ public class ReceptionInInterfaceEditPart extends CompartmentEditPart /** * @generated */ + @Override protected void refreshVisuals() { super.refreshVisuals(); refreshLabel(); @@ -564,7 +568,8 @@ public class ReceptionInInterfaceEditPart extends CompartmentEditPart * @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()); } @@ -581,7 +586,8 @@ public class ReceptionInInterfaceEditPart extends CompartmentEditPart * @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()); } @@ -590,11 +596,15 @@ public class ReceptionInInterfaceEditPart extends CompartmentEditPart /** * @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); } } @@ -602,6 +612,7 @@ public class ReceptionInInterfaceEditPart extends CompartmentEditPart /** * @generated */ + @Override protected void setFontColor(Color color) { getFigure().setForegroundColor(color); } @@ -609,6 +620,7 @@ public class ReceptionInInterfaceEditPart extends CompartmentEditPart /** * @generated */ + @Override protected void addSemanticListeners() { if (getParser() instanceof ISemanticParser) { EObject element = resolveSemanticElement(); @@ -624,6 +636,7 @@ public class ReceptionInInterfaceEditPart extends CompartmentEditPart /** * @generated */ + @Override protected void removeSemanticListeners() { if (parserElements != null) { for (int i = 0; i < parserElements.size(); i++) { @@ -637,6 +650,7 @@ public class ReceptionInInterfaceEditPart extends CompartmentEditPart /** * @generated */ + @Override protected AccessibleEditPart getAccessibleEditPart() { if (accessibleEP == null) { accessibleEP = new AccessibleGraphicalEditPart() { @@ -659,7 +673,7 @@ public class ReceptionInInterfaceEditPart extends CompartmentEditPart /** * 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 */ @@ -678,7 +692,7 @@ public class ReceptionInInterfaceEditPart extends CompartmentEditPart /** * Checks if an extended editor is present. - * + * * @return <code>true</code> if an extended editor is present. * @generated */ @@ -691,7 +705,7 @@ public class ReceptionInInterfaceEditPart extends CompartmentEditPart /** * Checks if a default direct edition is available - * + * * @return <code>true</code> if a default direct edition is available * @generated */ @@ -701,43 +715,42 @@ public class ReceptionInInterfaceEditPart extends CompartmentEditPart /** * Initializes the extended editor configuration + * * @generated */ 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); } } } /** * Updates the preference configuration + * * @generated */ 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; } } /** - * Performs the direct edit usually used by GMF editors. - * @param theRequest the direct edit request that starts the direct edit system - * @generated - */ + * Performs the direct edit usually used by GMF editors. + * + * @param theRequest + * the direct edit request that starts the direct edit system + * @generated + */ protected void performDefaultDirectEditorEdit(final Request theRequest) { // initialize the direct edit manager try { @@ -746,13 +759,11 @@ public class ReceptionInInterfaceEditPart extends CompartmentEditPart @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 { @@ -769,6 +780,7 @@ public class ReceptionInInterfaceEditPart extends CompartmentEditPart /** * @generated */ + @Override protected void addNotationalListeners() { super.addNotationalListeners(); addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$ @@ -777,6 +789,7 @@ public class ReceptionInInterfaceEditPart extends CompartmentEditPart /** * @generated */ + @Override protected void removeNotationalListeners() { super.removeNotationalListeners(); removeListenerFilter("PrimaryView"); //$NON-NLS-1$ @@ -785,6 +798,7 @@ public class ReceptionInInterfaceEditPart extends CompartmentEditPart /** * @generated */ + @Override protected void handleNotificationEvent(Notification event) { Object feature = event.getFeature(); if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) { @@ -794,10 +808,10 @@ public class ReceptionInInterfaceEditPart extends CompartmentEditPart 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())) { @@ -814,8 +828,7 @@ public class ReceptionInInterfaceEditPart extends CompartmentEditPart } } } - 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)) { @@ -827,6 +840,7 @@ public class ReceptionInInterfaceEditPart extends CompartmentEditPart /** * @generated */ + @Override protected IFigure createFigure() { IFigure label = createFigurePrim(); defaultText = getLabelTextHelper(label); |