diff options
Diffstat (limited to 'plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.extensionpoints.editors/src/org/eclipse/papyrus/infra/gmfdiag/extensionpoints/editors/configuration/IDirectEditorConfiguration.java')
1 files changed, 160 insertions, 0 deletions
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.extensionpoints.editors/src/org/eclipse/papyrus/infra/gmfdiag/extensionpoints/editors/configuration/IDirectEditorConfiguration.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.extensionpoints.editors/src/org/eclipse/papyrus/infra/gmfdiag/extensionpoints/editors/configuration/IDirectEditorConfiguration.java new file mode 100644 index 00000000000..eb14bed0467 --- /dev/null +++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.extensionpoints.editors/src/org/eclipse/papyrus/infra/gmfdiag/extensionpoints/editors/configuration/IDirectEditorConfiguration.java @@ -0,0 +1,160 @@ +/***************************************************************************** + * Copyright (c) 2008 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: + * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation + * Fanch BONNABESSE (ALL4TEC) fanch.bonnabesse@all4tec.net - Bug 497289 + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.gmfdiag.extensionpoints.editors.configuration; + +import org.eclipse.jface.dialogs.IInputValidator; +import org.eclipse.jface.text.source.SourceViewerConfiguration; +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.widgets.Composite; + +/** + * Interface that should be implemented by direct editors for Papyrus. + */ +public interface IDirectEditorConfiguration { + + /** + * Returns the style for the source viewer widget + * + * @return the style for the source viewer widget + * @see SWT + */ + // @unused + public int getStyle(); + + /** + * Returns the preferred size for the dialog window + * + * @return the preferred size for the dialog window + */ + // @unused + public Point getPreferedSize(); + + /** + * Returns the source viewer configuration for the editor + * + * @return the source viewer configuration for the editor + */ + public SourceViewerConfiguration getSourceViewerConfiguration(); + + /** + * Returns the text to edit + * + * @return the text to edit + */ + public String getTextToEdit(Object editedObject); + + /** + * Action executed before opening editor dialog window + * + * @return the result of this action + */ + public Object preEditAction(Object editedObject); + + /** + * Action executed before closing editor dialog window + * + * @param newText + * the text to save + * @return the result of this action + */ + public Object postEditAction(Object editedObject, String newText); + + /** + * Returns the extended Area for the dialog window + * + * @param parent + * the parent of the returned composite + * @return the extended Area for the dialog window or <code>null</code> if no extension is + * required + */ + public Composite createExtendedDialogArea(Composite parent); + + /** + * Returns the language of the edited body + * + * @return the language of the edited body + */ + public String getLanguage(); + + /** + * Sets the language of the edited body + * + * @param language + * the language of the edited body + */ + public void setLanguage(String language); + + /** + * Returns the input validator, ie indicates if the text is correct + */ + public IInputValidator getInputValidator(); + + /** + * Sets the input validator, ie the element that indicates if the text is correct + */ + // @unused + public void setInputValidator(IInputValidator validator); + + /** + * Get the text selection for the viewer + * + * @param value + * + * @return a selection + */ + public Selection getTextSelection(String value, Object editedObject); + + /** + * Class that represents an area for text selection + */ + public static class Selection { + + private final int lentgh; + + private final int start; + + public Selection(int start, int lentgh) { + this.start = start; + this.lentgh = lentgh; + } + + public int getLentgh() { + return lentgh; + } + + public int getStart() { + return start; + } + + } + + /** + * Get the superType attribute value. + * + * @return The value of superType. + */ + public boolean isSuperType(); + + /** + * Set the superType attribute value. + * + * @param superType + * the value to set. + */ + public void setSuperType(boolean superType); +} |