Class EmbeddingHelper
- java.lang.Object
-
- net.ssehub.easy.dslCore.ui.editors.EmbeddingHelper
-
public abstract class EmbeddingHelper extends java.lang.ObjectHelps embedding the xText-editor of a certain grammar.- Author:
- Holger Eichelberger, Christian Kröher
-
-
Constructor Summary
Constructors Constructor Description EmbeddingHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static IEmbeddedEditorembedEditor(java.net.URI file, org.eclipse.swt.widgets.Composite parent, com.google.inject.Injector injector)Embeds an xText editor for the given resource into the givenparent.static IEmbeddedEditorembedEditor(java.net.URI file, org.eclipse.swt.widgets.Composite parent, com.google.inject.Injector injector, java.lang.String[] content, boolean requireWorkspaceResource)Embeds an xText editor for the given resource into the givenparent.private static IEmbeddedEditorembedEditor(org.eclipse.swt.widgets.Composite parent, com.google.inject.Injector injector, org.eclipse.xtext.ui.editor.embedded.IEditedResourceProvider resourceProvider, java.lang.String[] content, boolean requireWorkspaceResource)Embeds an xText editor for the given resource into the givenparent.private static java.lang.StringgetResourceContent(java.net.URI file)Returns the content of the file identified by the given URI.
-
-
-
Method Detail
-
getResourceContent
private static java.lang.String getResourceContent(java.net.URI file)
Returns the content of the file identified by the given URI.- Parameters:
file- the URI that identifies the file- Returns:
- the content of the file as
Stringornullif the file does not exist
-
embedEditor
public static IEmbeddedEditor embedEditor(java.net.URI file, org.eclipse.swt.widgets.Composite parent, com.google.inject.Injector injector)
Embeds an xText editor for the given resource into the givenparent.- Parameters:
file- the file representing the resourceparent- the parent UI componentinjector- the injector configured for the editor and the grammar offile- Returns:
- the embedded editor (or null if embedding failed)
-
embedEditor
public static IEmbeddedEditor embedEditor(java.net.URI file, org.eclipse.swt.widgets.Composite parent, com.google.inject.Injector injector, java.lang.String[] content, boolean requireWorkspaceResource)
Embeds an xText editor for the given resource into the givenparent.- Parameters:
file- the file representing the resourceparent- the parent UI componentinjector- the injector configured for the editor and the grammar offilecontent- a split offileconsisting of the actual editable content in terms of prefix not to be shown [0], content to be displayed [1] and postfix not to be shown[2]requireWorkspaceResource- whether the editor requires a workspace resource and shall complain at least in the logs or whether it shall be silent- Returns:
- the embedded editor (or null if embedding failed)
-
embedEditor
private static IEmbeddedEditor embedEditor(org.eclipse.swt.widgets.Composite parent, com.google.inject.Injector injector, org.eclipse.xtext.ui.editor.embedded.IEditedResourceProvider resourceProvider, java.lang.String[] content, boolean requireWorkspaceResource)
Embeds an xText editor for the given resource into the givenparent.- Parameters:
parent- the parent UI componentinjector- the injector configured for the editor and the grammar offileresourceProvider- the resource to be displayedcontent- the actual editable content in terms of prefix not to be shown [0], content to be displayed [1] and postfix not to be shown[2]requireWorkspaceResource- whether the editor requires a workspace resource and shall complain at least in the logs or whether it shall be silent- Returns:
- the embedded editor (or null if embedding failed)
-
-