Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » XtextEditor inside a TitleAreaDialog is read-only ;-(
XtextEditor inside a TitleAreaDialog is read-only ;-( [message #559081] Wed, 15 September 2010 14:32 Go to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------030305090805040909070208
Content-Type: multipart/alternative;
boundary="------------050803080709050807030407"


--------------050803080709050807030407
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

It's taken me some time to finally get my XtextEditor running in a TitleAreaDialog:

| *public **void *run(IAction action)
{
*try*
{
*final *XtextEditor editor = *new *XtextEditor()
{
@Override
*protected *IStatusLineManager getStatusLineManager()
{
*return null*;
}
};

Injector injector = MyDslActivator.getInstance().getInjector("org.xtext.example.mydsl.MyDsl ");
injector.injectMembers(editor);

IEditorSite site = *new *DummySite();
IFile file = *new *DummyFile();
editor.init(site, *new *FileEditorInput(file));

Dialog dialog = *new *TitleAreaDialog(window.getShell())
{
@Override
*protected *Control createDialogArea(Composite parent)
{
Composite area = (Composite)*super*.createDialogArea(parent);
Composite contents = *new *Composite(area, SWT.NONE);
contents.setLayout(*new *FillLayout());
contents.setLayoutData(*new *GridData(SWT.FILL, SWT.FILL, true, *true*));

setTitle("MYDSL");
setMessage("Enter an expression.");

editor.createPartControl(contents);
*return *area;
}
};

dialog.open();
}
*catch *(Exception ex)
{
ex.printStackTrace();
}
}|


The dialog properly shows the default content that I provide via DummyFile.getContents(). Unfortunately the text area seems to be read-only and I can absolutley not find out why. Would you say the whole approach is odd or do you have an immediate idea?

I've attached the full code as a zip in case you wanna try it out. See SampleAction.java

Cheers
/Eike
Contact: http://www.esc-net.de Blogger <http://thegordian.blogspot.com>Twitter <http://twitter.com/eikestepper>Linkedin <http://de.linkedin.com/in/eikestepper>Xing <http://www.xing.com/profile/Eike_Stepper>
Article: What exactly is inside that p2 repository? < http://thegordian.blogspot.com/2010/05/what-exactly-is-insid e-that-p2.html>

I'm speaking at Eclipse Summit Europe 2010 <http://www.eclipsesummit.org/>



--------------050803080709050807030407
Content-Type: multipart/related;
boundary="------------050809040509000204020102"


--------------050809040509000204020102
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

<meta http-equiv="content-type" content="text/html; charset=ISO-8859-15">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi,<br>
<br>
It's taken me some time to finally get my XtextEditor running in a
TitleAreaDialog:<br>
<br>
<style type="text/css">code { font-family: Courier New,Courier; font-size: 10pt; margin: 0px; }</style>
<div class="java" align="left">
<table bgcolor="#ffffff" border="0" cellpadding="3"
cellspacing="0">
<tbody>
<tr>
<td nowrap="nowrap" align="left" valign="top"> <code>
<font color="#ffffff">


Re: XtextEditor inside a TitleAreaDialog is read-only ;-( [message #559209 is a reply to message #559081] Thu, 16 September 2010 00:40 Go to previous messageGo to next message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
Does it work if you feed it a real IFile resource instead of the
DummyFile instance?

- henrik

On 9/15/10 4:32 PM, Eike Stepper wrote:
> Hi,
>
> It's taken me some time to finally get my XtextEditor running in a
> TitleAreaDialog:
>
> | *public **void *run(IAction action)
> {
> *try*
> {
> *final *XtextEditor editor = *new *XtextEditor()
> {
> @Override
> *protected *IStatusLineManager getStatusLineManager()
> {
> *return null*;
> }
> };
>
> Injector injector = MyDslActivator.getInstance().getInjector("org.xtext.example.mydsl.MyDsl ");
> injector.injectMembers(editor);
>
> IEditorSite site = *new *DummySite();
> IFile file = *new *DummyFile();
> editor.init(site, *new *FileEditorInput(file));
>
> Dialog dialog = *new *TitleAreaDialog(window.getShell())
> {
> @Override
> *protected *Control createDialogArea(Composite parent)
> {
> Composite area = (Composite)*super*.createDialogArea(parent);
> Composite contents = *new *Composite(area, SWT.NONE);
> contents.setLayout(*new *FillLayout());
> contents.setLayoutData(*new *GridData(SWT.FILL, SWT.FILL, true, *true*));
>
> setTitle("MYDSL");
> setMessage("Enter an expression.");
>
> editor.createPartControl(contents);
> *return *area;
> }
> };
>
> dialog.open();
> }
> *catch *(Exception ex)
> {
> ex.printStackTrace();
> }
> }|
>
>
> The dialog properly shows the default content that I provide via
> DummyFile.getContents(). Unfortunately the text area seems to be
> read-only and I can absolutley not find out why. Would you say the whole
> approach is odd or do you have an immediate idea?
>
> I've attached the full code as a zip in case you wanna try it out. See
> SampleAction.java
>
> Cheers
> /Eike
> Contact: http://www.esc-net.de Blogger
> <http://thegordian.blogspot.com>Twitter
> <http://twitter.com/eikestepper>Linkedin
> <http://de.linkedin.com/in/eikestepper>Xing
> <http://www.xing.com/profile/Eike_Stepper>
> Article: What exactly is inside that p2 repository?
> < http://thegordian.blogspot.com/2010/05/what-exactly-is-insid e-that-p2.html>
>
> I'm speaking at Eclipse Summit Europe 2010 <http://www.eclipsesummit.org/>
>
>
Re: XtextEditor inside a TitleAreaDialog is read-only ;-( [message #559225 is a reply to message #559209] Thu, 16 September 2010 05:28 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 16.09.2010 02:40, schrieb Henrik Lindberg:
> Does it work if you feed it a real IFile resource instead of the DummyFile instance?
Should have tested that before! Yes, it does work then.

Unfortunately I still have no clue what in my DummyFile cauase the editor to think that it's read-only, nor how I can find that out ;-(

Cheers
/Eike

>
> - henrik
>
> On 9/15/10 4:32 PM, Eike Stepper wrote:
>> Hi,
>>
>> It's taken me some time to finally get my XtextEditor running in a
>> TitleAreaDialog:
>>
>> | *public **void *run(IAction action)
>> {
>> *try*
>> {
>> *final *XtextEditor editor = *new *XtextEditor()
>> {
>> @Override
>> *protected *IStatusLineManager getStatusLineManager()
>> {
>> *return null*;
>> }
>> };
>>
>> Injector injector = MyDslActivator.getInstance().getInjector("org.xtext.example.mydsl.MyDsl ");
>> injector.injectMembers(editor);
>>
>> IEditorSite site = *new *DummySite();
>> IFile file = *new *DummyFile();
>> editor.init(site, *new *FileEditorInput(file));
>>
>> Dialog dialog = *new *TitleAreaDialog(window.getShell())
>> {
>> @Override
>> *protected *Control createDialogArea(Composite parent)
>> {
>> Composite area = (Composite)*super*.createDialogArea(parent);
>> Composite contents = *new *Composite(area, SWT.NONE);
>> contents.setLayout(*new *FillLayout());
>> contents.setLayoutData(*new *GridData(SWT.FILL, SWT.FILL, true, *true*));
>>
>> setTitle("MYDSL");
>> setMessage("Enter an expression.");
>>
>> editor.createPartControl(contents);
>> *return *area;
>> }
>> };
>>
>> dialog.open();
>> }
>> *catch *(Exception ex)
>> {
>> ex.printStackTrace();
>> }
>> }|
>>
>>
>> The dialog properly shows the default content that I provide via
>> DummyFile.getContents(). Unfortunately the text area seems to be
>> read-only and I can absolutley not find out why. Would you say the whole
>> approach is odd or do you have an immediate idea?
>>
>> I've attached the full code as a zip in case you wanna try it out. See
>> SampleAction.java
>>
>> Cheers
>> /Eike
>> Contact: http://www.esc-net.de Blogger
>> <http://thegordian.blogspot.com>Twitter
>> <http://twitter.com/eikestepper>Linkedin
>> <http://de.linkedin.com/in/eikestepper>Xing
>> <http://www.xing.com/profile/Eike_Stepper>
>> Article: What exactly is inside that p2 repository?
>> < http://thegordian.blogspot.com/2010/05/what-exactly-is-insid e-that-p2.html>
>>
>> I'm speaking at Eclipse Summit Europe 2010 <http://www.eclipsesummit.org/>
>>
>>
>


Re: XtextEditor inside a TitleAreaDialog is read-only ;-( [message #559229 is a reply to message #559225] Thu, 16 September 2010 06:01 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------050205060508010907000109
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

I'm willing to create temp files outside of the workspace as a means of communication buffer between the dialog and the application:

| File tempFile = File.createTempFile("xtext-", ".tmp");
IFileStore fileStore = EFS.getLocalFileSystem().getStore(tempFile.toURI());
editor.init(*new *DummySite(), *new *FileStoreEditorInput(fileStore));|


Unfortunately that leads to an exception:

org.eclipse.ui.PartInitException: Editor could not be initialized.
at org.eclipse.ui.texteditor.AbstractTextEditor.internalInit(Ab stractTextEditor.java:3071)
at org.eclipse.ui.texteditor.AbstractTextEditor.init(AbstractTe xtEditor.java:3082)
at org.eclipse.xtext.ui.editor.XtextEditor.init(XtextEditor.jav a:169)
at org.xtext.example.mydsl.ui.actions.SampleAction.run(SampleAc tion.java:109)
at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginActi on.java:251)
at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPl uginAction.java:229)
at org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem$6.handleEven t(ActionContributionItem.java:452)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3657)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2629)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:24 27)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670)
at org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:663)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:115)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
*Caused by: java.lang.NullPointerException
at org.eclipse.xtext.ui.editor.model.XtextDocumentProvider.crea teElementInfo(XtextDocumentProvider.java:123)*
at org.eclipse.ui.texteditor.AbstractDocumentProvider.connect(A bstractDocumentProvider.java:400)
at org.eclipse.ui.texteditor.AbstractTextEditor.doSetInput(Abst ractTextEditor.java:4050)
at org.eclipse.ui.texteditor.StatusTextEditor.doSetInput(Status TextEditor.java:217)
at org.eclipse.ui.texteditor.AbstractDecoratedTextEditor.doSetI nput(AbstractDecoratedTextEditor.java:1444)
at org.eclipse.ui.editors.text.TextEditor.doSetInput(TextEditor .java:169)
at org.eclipse.xtext.ui.editor.XtextEditor.doSetInput(XtextEdit or.java:149)
at org.eclipse.ui.texteditor.AbstractTextEditor$19.run(Abstract TextEditor.java:3037)
at org.eclipse.jface.operation.ModalContext.runInCurrentThread( ModalContext.java:464)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.ja va:372)
at org.eclipse.jface.window.ApplicationWindow$1.run(Application Window.java:759)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at org.eclipse.jface.window.ApplicationWindow.run(ApplicationWi ndow.java:756)
at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow. java:2600)
at org.eclipse.ui.texteditor.AbstractTextEditor.internalInit(Ab stractTextEditor.java:3055)
... 33 more

I.e. here:

@Override
protected ElementInfo createElementInfo(Object element) throws CoreException {
ElementInfo info = super.createElementInfo(element);
XtextDocument doc = (XtextDocument) info.fDocument;
AnnotationIssueProcessor annotationIssueProcessor = new AnnotationIssueProcessor(doc, info.fModel, issueResolutionProvider);
ValidationJob job = new ValidationJob(resourceValidator, doc, annotationIssueProcessor,CheckMode.FAST_ONLY);
*doc.setValidationJob(job);*
return info;
}

I'd really prefer not to create temp files somewhere in the workspace ;-(

Cheers
/Eike
Contact: http://www.esc-net.de Blogger <http://thegordian.blogspot.com>Twitter <http://twitter.com/eikestepper>Linkedin <http://de.linkedin.com/in/eikestepper>Xing <http://www.xing.com/profile/Eike_Stepper>
Article: What exactly is inside that p2 repository? < http://thegordian.blogspot.com/2010/05/what-exactly-is-insid e-that-p2.html>

I'm speaking at Eclipse Summit Europe 2010 <http://www.eclipsesummit.org/>


--------------050205060508010907000109
Content-Type: multipart/related;
boundary="------------010902020400000308030602"


--------------010902020400000308030602
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-15"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<meta content="text/html; charset=ISO-8859-15"
http-equiv="Content-Type">
<title></title>
<meta content="text/html; charset=ISO-8859-15"
http-equiv="Content-Type">
<title></title>
I'm willing to create temp files outside of the workspace as a means
of communication buffer between the dialog and the application:<br>
<br>
<style type="text/css">code { font-family: Courier New,Courier; font-size: 10pt; margin: 0px; }</style>
<div class="java" align="left">
<table bgcolor="#ffffff" border="0" cellpadding="3"
cellspacing="0">
<tbody>
<tr>
<td nowrap="nowrap" align="left" valign="top"> <code>
<font color="#ffffff">


Re: XtextEditor inside a TitleAreaDialog is read-only ;-( [message #559234 is a reply to message #559229] Thu, 16 September 2010 06:45 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi Eike,

did you try the approach that was used here:
http://code.google.com/a/eclipselabs.org/p/xtext-forms-integ ration/source/browse/#svn/trunk/plugins/org.eclipselabs.xtfo .demo.rcp/src/org/eclipselabs/xtfo/demo/rcp/partialEditing
?
It uses a SourceViewer instead of a full editor and is thereby more
flexible, e.g. you do not need a physical file to edit a resource.

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com


Am 16.09.10 08:01, schrieb Eike Stepper:
> I'm willing to create temp files outside of the workspace as a
> means of communication buffer between the dialog and the application:
>
> | File tempFile = File.createTempFile("xtext-", ".tmp");
> IFileStore fileStore = EFS.getLocalFileSystem().getStore(tempFile.toURI());
> editor.init(*new *DummySite(), *new *FileStoreEditorInput(fileStore));|
>
>
> Unfortunately that leads to an exception:
>
> org.eclipse.ui.PartInitException: Editor could not be initialized.
> at
> org.eclipse.ui.texteditor.AbstractTextEditor.internalInit(Ab stractTextEditor.java:3071)
> at
> org.eclipse.ui.texteditor.AbstractTextEditor.init(AbstractTe xtEditor.java:3082)
> at org.eclipse.xtext.ui.editor.XtextEditor.init(XtextEditor.jav a:169)
> at
> org.xtext.example.mydsl.ui.actions.SampleAction.run(SampleAc tion.java:109)
> at
> org.eclipse.ui.internal.PluginAction.runWithEvent(PluginActi on.java:251)
> at
> org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPl uginAction.java:229)
> at
> org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:584)
> at
> org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:501)
> at
> org.eclipse.jface.action.ActionContributionItem$6.handleEven t(ActionContributionItem.java:452)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:4066)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3657)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2629)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)
> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:24 27)
> at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670)
> at
> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
> at
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:663)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
> at
> org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:115)
> at
> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:196)
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:369)
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 619)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
> at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
> *Caused by: java.lang.NullPointerException
> at
> org.eclipse.xtext.ui.editor.model.XtextDocumentProvider.crea teElementInfo(XtextDocumentProvider.java:123)*
> at
> org.eclipse.ui.texteditor.AbstractDocumentProvider.connect(A bstractDocumentProvider.java:400)
> at
> org.eclipse.ui.texteditor.AbstractTextEditor.doSetInput(Abst ractTextEditor.java:4050)
> at
> org.eclipse.ui.texteditor.StatusTextEditor.doSetInput(Status TextEditor.java:217)
> at
> org.eclipse.ui.texteditor.AbstractDecoratedTextEditor.doSetI nput(AbstractDecoratedTextEditor.java:1444)
> at
> org.eclipse.ui.editors.text.TextEditor.doSetInput(TextEditor .java:169)
> at
> org.eclipse.xtext.ui.editor.XtextEditor.doSetInput(XtextEdit or.java:149)
> at
> org.eclipse.ui.texteditor.AbstractTextEditor$19.run(Abstract TextEditor.java:3037)
> at
> org.eclipse.jface.operation.ModalContext.runInCurrentThread( ModalContext.java:464)
> at org.eclipse.jface.operation.ModalContext.run(ModalContext.ja va:372)
> at
> org.eclipse.jface.window.ApplicationWindow$1.run(Application Window.java:759)
> at
> org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
> at
> org.eclipse.jface.window.ApplicationWindow.run(ApplicationWi ndow.java:756)
> at
> org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow. java:2600)
> at
> org.eclipse.ui.texteditor.AbstractTextEditor.internalInit(Ab stractTextEditor.java:3055)
> ... 33 more
>
> I.e. here:
>
> @Override
> protected ElementInfo createElementInfo(Object element) throws
> CoreException {
> ElementInfo info = super.createElementInfo(element);
> XtextDocument doc = (XtextDocument) info.fDocument;
> AnnotationIssueProcessor annotationIssueProcessor = new
> AnnotationIssueProcessor(doc, info.fModel, issueResolutionProvider);
> ValidationJob job = new ValidationJob(resourceValidator, doc,
> annotationIssueProcessor,CheckMode.FAST_ONLY);
> *doc.setValidationJob(job);*
> return info;
> }
>
> I'd really prefer not to create temp files somewhere in the workspace ;-(
>
> Cheers
> /Eike
> Contact: http://www.esc-net.de Blogger
> <http://thegordian.blogspot.com>Twitter
> <http://twitter.com/eikestepper>Linkedin
> <http://de.linkedin.com/in/eikestepper>Xing
> <http://www.xing.com/profile/Eike_Stepper>
> Article: What exactly is inside that p2 repository?
> < http://thegordian.blogspot.com/2010/05/what-exactly-is-insid e-that-p2.html>
>
> I'm speaking at Eclipse Summit Europe 2010 <http://www.eclipsesummit.org/>
>
Re: XtextEditor inside a TitleAreaDialog is read-only ;-( [message #559238 is a reply to message #559234] Thu, 16 September 2010 06:56 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------080406070706000606090803
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Hi Sebastian,

Yes, I've looked at it but it's a whole lot of UI code () most of it probably being already in the XtextEditor) and I do not see that I'd be able to maintain that. Nor can I pretend that I even understand most of it.

Is there really no easy and built-in way to use Xtext without an EditorPart?

Cheers
/Eike
Contact: http://www.esc-net.de Blogger <http://thegordian.blogspot.com>Twitter <http://twitter.com/eikestepper>Linkedin <http://de.linkedin.com/in/eikestepper>Xing <http://www.xing.com/profile/Eike_Stepper>
Article: What exactly is inside that p2 repository? < http://thegordian.blogspot.com/2010/05/what-exactly-is-insid e-that-p2.html>

I'm speaking at Eclipse Summit Europe 2010 <http://www.eclipsesummit.org/>



Am 16.09.2010 08:45, schrieb Sebastian Zarnekow:
> Hi Eike,
>
> did you try the approach that was used here: http://code.google.com/a/eclipselabs.org/p/xtext-forms-integ ration/source/browse/#svn/trunk/plugins/org.eclipselabs.xtfo .demo.rcp/src/org/eclipselabs/xtfo/demo/rcp/partialEditing ?
> It uses a SourceViewer instead of a full editor and is thereby more flexible, e.g. you do not need a physical file to edit a resource.
>
> Regards,
> Sebastian

--------------080406070706000606090803
Content-Type: multipart/related;
boundary="------------070303090708090507020707"


--------------070303090708090507020707
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 7bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<meta content="text/html; charset=ISO-8859-15"
http-equiv="Content-Type">
<meta content="text/html; charset=ISO-8859-15"
http-equiv="Content-Type">
Hi Sebastian,<br>
<br>
Yes, I've looked at it but it's a whole lot of UI code () most of it
probably being already in the XtextEditor) and I do not see that I'd
be able to maintain that. Nor can I pretend that I even understand
most of it.<br>
<br>
Is there really no easy and built-in way to use Xtext without an
EditorPart?<br>
<br>
<!--WISESTAMP_SIG_91695_START--><span style="color: black;">
<div dir="ltr">
<div>Cheers<br>
/Eike<br>
</div>
<div style="padding: 5px 0pt; font-family: arial,sans-serif;
font-size: 13.3px;"><span style="color: gray;">Contact: <a
href="http://www.esc-net.de">http://www.esc-net.de</a></span>
<a href="http://thegordian.blogspot.com" style="padding: 0pt
2px; color: blue; font-size: 10pt;" _service=""><img
src="cid:part1.09000302.04000800@esc-net.de" alt="Blogger"
style="vertical-align: middle; padding-bottom: 5px;"
border="0" height="16" width="16"></a><a
href="http://twitter.com/eikestepper" style="padding: 0pt
2px; color: blue; font-size: 10pt;" _service=""><img
src="cid:part2.01060508.06010806@esc-net.de" alt="Twitter"
style="vertical-align: middle; padding-bottom: 5px;"
border="0" height="16" width="16"></a><a
href="http://de.linkedin.com/in/eikestepper" style="padding:
0pt 2px; color: blue; font-size: 10pt;" _service=""><img
src="cid:part3.06050209.08010905@esc-net.de"
alt="Linkedin" style="vertical-align: middle;
padding-bottom: 5px;" border="0" height="16" width="16"></a><a
href="http://www.xing.com/profile/Eike_Stepper"
style="padding: 0pt 2px; color: blue; font-size: 10pt;"
_service=""><img
src="cid:part4.05070604.09020509@esc-net.de" alt="Xing"
style="vertical-align: middle; padding-bottom: 5px;"
border="0" height="16" width="16"></a></div>
<div style="color: gray; font-size: 13.3px; padding-bottom:
5px;">Article: <span style="color: blue; text-decoration:
underline;"><a
href=" http://thegordian.blogspot.com/2010/05/what-exactly-is-insid e-that-p2.html"
undefined="">What exactly is inside that p2 repository?</a></span></div>
<div><br>
<a href="http://www.eclipsesummit.org/"><img
src="cid:part5.04030704.05010106@esc-net.de" alt="I'm
speaking at Eclipse Summit Europe 2010" border="0"
height="100" width="100"></a>
<br>
<br>
</div>
</div>
</span><!--WISESTAMP_SIG_91695_END--><br>
<br>
Am 16.09.2010 08:45, schrieb Sebastian Zarnekow:
<blockquote cite="mid:i6seep$3gf$1@build.eclipse.org" type="cite">Hi
Eike,
<br>
<br>
did you try the approach that was used here:
<a class="moz-txt-link-freetext" href=" http://code.google.com/a/eclipselabs.org/p/xtext-forms-integ ration/source/browse/#svn/trunk/plugins/org.eclipselabs.xtfo .demo.rcp/src/org/eclipselabs/xtfo/demo/rcp/partialEditing"> http://code.google.com/a/eclipselabs.org/p/xtext-forms-integ ration/source/browse/#svn/trunk/plugins/org.eclipselabs.xtfo .demo.rcp/src/org/eclipselabs/xtfo/demo/rcp/partialEditing</a>
?
<br>
It uses a SourceViewer instead of a full editor and is thereby
more flexible, e.g. you do not need a physical file to edit a
resource.
<br>
<br>
Regards,
<br>
Sebastian
<br>
</blockquote>
</body>
</html>

--------------070303090708090507020707
Content-Type: image/png;
name="blogger.png"
Content-Transfer-Encoding: base64
Content-ID: <part1.09000302.04000800@esc-net.de>
Content-Disposition: inline;
filename="blogger.png"

iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAAK/I NwWK6QAAABl0
RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAADkUExURf9xEv9m AP////9lAP+Q
SP9kAP9jAP9fAP9nAf9vD//x5/9hAP/iz/9iAP9eAP/s4P9vEP9yEv9qAP9q B/+LRP+we/90
I/+RSP/z6/+jZv/y6P+8kP/59f5yE//awf/Ttv9hAf9nAv/17v+4if9sC/9o BP+bWP/r3v/k
0v+wfP+QRv/o2f9gAP+OQ/93HP/l0/+0gv/Rsv/9/P/j0P+pcP+0hf/dx//D m//+/v+td/9o
AP+NQv/Yvf+zgv/x6P/q2/9xG//p2f9pAP/s3//8+fxxE//ex/+AK/9oCP/j 0f/Uuv///4Xw
StcAAABMdFJOU/////////////////////////////////////////////// ////////////
/////////////////////////////////////////wCejeTMAAAAsklEQVR4 2kSP1w6DMBAE
7cMGQg0hvffee++d//+f2IaIeTlppNXtIo88UAjxEIlhjCUG5lwJQuwoulqh FuUGcWGSiTF7
bt40EEoXBKtyIPQS5PffFqyHlhCS2obTK5kDmJ8lXxgA0zsPXer0L3zSUVmI D9ip3SC+hKwQ
2CxCtXYYL25gu1S8bf4jib5fTM+MNE079jom/+KwJUojwnAVifcQ46jM4M23 BHmkEK53iPcT
YACE/Q4KzoVQVwAAAABJRU5ErkJggg==
--------------070303090708090507020707
Content-Type: image/png;
name="twitter.png"
Content-Transfer-Encoding: base64
Content-ID: <part2.01060508.06010806@esc-net.de>
Content-Disposition: inline;
filename="twitter.png"

iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/ AP+gvaeTAAAA
CXBIWXMAAABIAAAASABGyWs+AAAACXZwQWcAAAAQAAAAEABcxq3DAAABxUlE QVQ4y4WTMW4U
QRBFX3X3zoy8FgZphTCYAEg4gAPEYbgBJEgEXIALkHMfAjIwItnAAfLK2JYB r3dmuj7BzI5m
2WBLqqzq//q/fxt9NTmrzo7MCIhgRpWSsaMSgEta5czcjYtWTKPxfALZXTEE 2wmAxLXD11VL
BZy2MAuJB/iuA3oAoJb4lUUCVkAGTM5t06gjATMjBiPFaFsADvx1MTFoBd/q zHkMeLcLgCEe
JqjbrCJ1IAkghGDz20Z/XEzMMMTnZTsSYANMAl7fq7YlZOBaUCCk4WowwyRA mBmL7CxcmwDu
rh+rzKU71YhQ/dnr8VbiaRF4MgmbAAZkxJU7lRk3Wby5W3FcJlbSICAjZjFS jJ42rSXWgoWL
fYPfLvaCMTVxJ0XoJTmQ/stF6GPABDhzcepi7uJ74yQDuXcDErjjGhkwNvHx xCjMOMkCg3eX
S85zyVEMtGt24GWVxvsM5yi3+nBV8/7iBmJv0gaZQMZhNL4cHXBYdDkY7HQL vD0oebVfQuud
a8FGHSAaP1vnpMmbHgDEECwafLq/x8fZlGfJKCVKiapvXLyoEsdl3JYwBMpd uW1YEjlz4aMh
AY+iURiU/Vf/B6EE4kjfs5YLAAAAAElFTkSuQmCC
--------------070303090708090507020707
Content-Type: image/png;
name="linkedin.png"
Content-Transfer-Encoding: base64
Content-ID: <part3.06050209.08010905@esc-net.de>
Content-Disposition: inline;
filename="linkedin.png"

iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/ AP+gvaeTAAAA
CXBIWXMAAABIAAAASABGyWs+AAAACXZwQWcAAAAQAAAAEABcxq3DAAACGklE QVQ4y6WTO2sU
URTHf3dmdp0kTnZJzErSrPjKYqNY2GljodhoLRLB1sLCD2DrZxAsfCAE/AaC grY+SBQSFTSC
xizGzZ3MTiYz92UxY5KNYuOBP+eew/3/73lwxfWHT9yjuR8YL0CwyxygAAPo Cqr0ntFcvjBB
cH++x8WzJzm8v/EnWVdks0PEgNWO95/XePD4HZ4ADk6MAhD6Hs26/08yBjwr ODrZBK0JADyv
LP7GsX2Evse9xR5Lsvgr+XfsO7ctoKwj9AWh7wEQIFCF+3sFGjCmgiJwQFwY Yge3X3cZrwXM
r2SDg9tJ1rokaw1alRXI3NAO61w60AAHTkE7qtNu1PjSUywsb3L60AgjNcHz hZgXb39WApoA
C3FqsIGjMxYC8OZbxlQU0GmFTLdCznWireV0pobYSDKevuzilMZDg0wN/cxu XdrMLVqX53TT
cu3OJ87cmmdlrQBgemoYKTMwqhSI+4Z0QMBhjANgcTnj1UdJHGd8Xc0AmBit Ecu0moGGODH0
h7cF8tyidSmgjSWWG6AUWpkypw1xLwXA4z8tQINcN/T3moEWtLZbr0mZQV5s 55RFJuU8RHR1
1iWtIzQ8nxOtIVCw9D2lWbM06w4ZZ8wtrEJRcLw9TDMUyKRg7kOPSHQR0ZVZ lyRjMDkOOVAU
FfLS57viHRaJLsHM+THuPtuDUgLTW2U0X672t47rrw82vOu/z9w8xS+MkDzV Boy6+QAAAABJ
RU5ErkJggg==
--------------070303090708090507020707
Content-Type: image/png;
name="xing.png"
Content-Transfer-Encoding: base64
Content-ID: <part4.05070604.09020509@esc-net.de>
Content-Disposition: inline;
filename="xing.png"

iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAACXBIWXMAAAsT AAALEwEAmpwY
AAABsklEQVR42mP8//8/AymAEb+G1x9333hU9fffZy52ZTONrQQ0/P7z7sLd hJfvN7Mw80mL
ROkqTodqAIKvv379+fuXhZmZh50dpv7f49dLLt1LYWD4ryRZCETsrJIIDYdu 3y5fu16AizPE
0CTFzgoo8fPXoxPX/T9/v8DHbWCito6LXRHFDw/evnXpm3D39Ws1Eck9xVmy wqLP3/SevlXC
ysKtLtuoJFmMxdObL17ymzqN8S9LnZddua/VrUcWD149FRNwNFFby8oiiEXD itNnImfN5WTi
nBhu7Gvw5OLdiv+MQnqKU6WEI7AE6+vPnx17+68+fmGrJL0wRe/rl/jbL94r isfqKs1kZuJE
1/Dt16/27TtatmzjYeZcnuZpqnDi3J16FmZxYDhKCAViibiVp8+Ur1v39N0H X12DFRkJ33/u
O3LVk+E/i5xYqq7iNCwaXn769PLTZ0ZGBnFePjE+3j9/3155kPvk9XIudgV9 5XnCfI6Ek8a7
T4dO3vD4+++HlHC4kepywhr+/P0ITEIPXk5jZxXTVpgE1EY48X36euHs7fBv P+8CVespzYGH
FSOpyRsAAuDh4a3m5z0AAAAASUVORK5CYII=
--------------070303090708090507020707
Content-Type: image/gif;
name="100x100_speaking.gif"
Content-Transfer-Encoding: base64
Content-ID: <part5.04030704.05010106@esc-net.de>
Content-Disposition: inline;
filename="100x100_speaking.gif"

R0lGODlhZABkAOZ/APb3+VNYfigtUDRDchhWpwM6mkRXjThrsCdirVJ7u0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BtDN3FzO/MzPwvzN3bzOsQzN7wytkyLPCNEHqVzP9py8+KzPEK3PkBzRAa3G 7bzKFvypsYLQ
HNEHmGPIDC3LI4DP+azPJH3SKA3LqvzOGR0rF0ADrowQawDNYxzSI53SJM3B Of3DqhwpGh0r
ZEDEW9FyqgzNIW3NC33UR23IZfzTG53BHFEBYkDTVK3UVn3RhvwqaSVfMD3U isABcEDVYj3W
ZJ3VIgQra6XIXp2wGBAAZf3WY/wqWh0pWx0rMiDUa83WATBCdN3Xfv3XQVJc d53XknBDYgDY
iE1P18XFJmRAA3hN2JHb1okd2IstXzJAA1AN2Y0AABmkATyD1pU9KapDA5it 2fbA2ThkBGiy
2vMyQiLU2KSdoqbt1Sla25xt2y0427q924UQCAA7
--------------070303090708090507020707--

--------------080406070706000606090803--


Re: XtextEditor inside a TitleAreaDialog is read-only ;-( [message #559250 is a reply to message #559238] Thu, 16 September 2010 07:39 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi Eike,

there will be an easy way in the next version of Xtext but so long
you'll either have to hassle with the UI stuff or with the editor
framework of Eclipse.
Creating temporary files outside of your workspace will lead to other
problems as well, e.g. the global visibility rules have to tailored if
the resource does not reside in an IProject ...

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 16.09.10 08:56, schrieb Eike Stepper:
> Hi Sebastian,
>
> Yes, I've looked at it but it's a whole lot of UI code () most of it
> probably being already in the XtextEditor) and I do not see that I'd be
> able to maintain that. Nor can I pretend that I even understand most of it.
>
> Is there really no easy and built-in way to use Xtext without an EditorPart?
>
> Cheers
> /Eike
> Contact: http://www.esc-net.de Blogger
> <http://thegordian.blogspot.com>Twitter
> <http://twitter.com/eikestepper>Linkedin
> <http://de.linkedin.com/in/eikestepper>Xing
> <http://www.xing.com/profile/Eike_Stepper>
> Article: What exactly is inside that p2 repository?
> < http://thegordian.blogspot.com/2010/05/what-exactly-is-insid e-that-p2.html>
>
> I'm speaking at Eclipse Summit Europe 2010 <http://www.eclipsesummit.org/>
>
>
>
> Am 16.09.2010 08:45, schrieb Sebastian Zarnekow:
>> Hi Eike,
>>
>> did you try the approach that was used here:
>> http://code.google.com/a/eclipselabs.org/p/xtext-forms-integ ration/source/browse/#svn/trunk/plugins/org.eclipselabs.xtfo .demo.rcp/src/org/eclipselabs/xtfo/demo/rcp/partialEditing
>> ?
>> It uses a SourceViewer instead of a full editor and is thereby more
>> flexible, e.g. you do not need a physical file to edit a resource.
>>
>> Regards,
>> Sebastian
Re: XtextEditor inside a TitleAreaDialog is read-only ;-( [message #559255 is a reply to message #559250] Thu, 16 September 2010 07:55 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------040305090102070808070708
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Am 16.09.2010 09:39, schrieb Sebastian Zarnekow:
> Hi Eike,
>
> there will be an easy way in the next version of Xtext
I'd be happy with I/S-builds if only I have not to wait until Indigo GA ;-)

> but so long you'll either have to hassle with the UI stuff or with the editor framework of Eclipse.
> Creating temporary files outside of your workspace will lead to other problems as well, e.g. the global visibility rules have to tailored if the resource does not reside in an IProject ...
I've made some progress with my editor approach. This works:

| IStorage storage = *new *TempStorage("test.mydsl", "is project");
editor.init(*new *DummySite(), *new *StorageEditorInput(storage));|


With:

| *public final class *TempStorage *extends *PlatformObject *implements *IEncodedStorage
{
*private *String name;

*private *String contents;

*public *TempStorage(String name, String contents)
{
*this*.name = name;
*this*.contents = contents;
}

*public *String getName()
{
*return *name;
}

*public *InputStream getContents() *throws *CoreException
{
*return new *ByteArrayInputStream(contents.getBytes());
}

*public *IPath getFullPath()
{
*return new *Path(name).makeAbsolute();
}

*public **boolean *isReadOnly()
{
*return false*;
}

*public *String getCharset() *throws *CoreException
{
*return *"UTF-8";
}
}|


And:

| *public class *StorageEditorInput *extends *PlatformObject *implements *IStorageEditorInput
{
*private *IStorage storage;

*public *StorageEditorInput(IStorage storage)
{
*this*.storage = storage;
}

*public *IStorage getStorage() *throws *CoreException
{
*return *storage;
}

*public **boolean *exists()
{
*return true*;
}

*public *String getName()
{
*return *storage.getName();
}

*public *ImageDescriptor getImageDescriptor()
{
*return null*;
}

*public *String getToolTipText()
{
*return null*;
}

*public *IPersistableElement getPersistable()
{
*return null*;
}
}|


Further I had to adjust my Guice module:

| *public class *MyDslUiModule *extends *org.xtext.example.mydsl.ui.AbstractMyDslUiModule
{
*public *MyDslUiModule(AbstractUIPlugin plugin)
{
*super*(plugin);
}

@Override
*public *Class<? *extends *IXtextEditorCallback> bindIXtextEditorCallback()
{
*return _null_*;
}

@Override
*public *Class<? *extends *IResourceForEditorInputFactory> bindIResourceForEditorInputFactory()
{
* *_*return TempStorageResourceForIEditorInputFactory.class;*_
}

*public static class *TempStorageResourceForIEditorInputFactory *extends *ResourceForIEditorInputFactory
{
@Override
*protected *Resource createResource(IStorage storage) *throws *CoreException
{
*if *(storage *instanceof *TempStorage)
{
*return *createResourceFor((TempStorage)storage);
}

*return super*.createResource(storage);
}

*protected *Resource createResourceFor(TempStorage storage) *throws *CoreException
{
ResourceSet resourceSet = getResourceSet(storage);
URI uri = _*URI.createFileURI*__*(storage.getName());*_
configureResourceSet(resourceSet, uri);
XtextResource resource = createResource(resourceSet, uri);
resource.setValidationDisabled(_*true*_);
*return *resource;
}
}
}|


Nevertheless I run into problems because the annotationModel is null. I'm currently trying to apply some minor changes to o.e.xtext.ui to be a little more tolerant against non-IFile based resources...

Cheers
/Eike



--------------040305090102070808070708
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Am 16.09.2010 09:39, schrieb Sebastian Zarnekow:
<blockquote cite="mid:i6shil$lek$1@build.eclipse.org" type="cite">Hi
Eike,
<br>
<br>
there will be an easy way in the next version of Xtext</blockquote>
I'd be happy with I/S-builds if only I have not to wait until Indigo
GA ;-)<br>
<br>
<blockquote cite="mid:i6shil$lek$1@build.eclipse.org" type="cite">
but so long you'll either have to hassle with the UI stuff or with
the editor framework of Eclipse.
<br>
Creating temporary files outside of your workspace will lead to
other problems as well, e.g. the global visibility rules have to
tailored if the resource does not reside in an IProject ...
<br>
</blockquote>
I've made some progress with my editor approach. This works:<br>
<br>
<style type="text/css">code { font-family: Courier New,Courier; font-size: 10pt; margin: 0px; }</style>
<div class="java" align="left">
<table bgcolor="#ffffff" border="0" cellpadding="3"
cellspacing="0">
<tbody>
<tr>
<td nowrap="nowrap" align="left" valign="top"> <code>
<font color="#ffffff">


Using EmbeddedXtextEditor now [message #559547 is a reply to message #559234] Fri, 17 September 2010 06:33 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------000904000505080708020201
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Am 16.09.2010 08:45, schrieb Sebastian Zarnekow:
> Hi Eike,
>
> did you try the approach that was used here: http://code.google.com/a/eclipselabs.org/p/xtext-forms-integ ration/source/browse/#svn/trunk/plugins/org.eclipselabs.xtfo .demo.rcp/src/org/eclipselabs/xtfo/demo/rcp/partialEditing ?
> It uses a SourceViewer instead of a full editor and is thereby more flexible, e.g. you do not need a physical file to edit a resource.
Okay, I've given up on my EditorPart based approach and instead succeeded to use the code you pointed me to ;-)

However that code is also not immediately prepared to run outside of an editor. I had to add some not-null checks:

| *public **void *focusLost(FocusEvent e)
{
_*if (fContextActivation != null)*_
{
IContextService contextService = (IContextService)getActiveEditor().getSite().getService(ICon textService.*class*);
contextService.deactivateContext(fContextActivation);
}

IHandlerService handlerService = (IHandlerService)PlatformUI.getWorkbench().getAdapter(IHandl erService.*class*);
handlerService.deactivateHandlers(fHandlerActivations);
}

*public **void *focusGained(FocusEvent e)
{
IEditorPart editor = getActiveEditor();
_*if (editor != null)*_
{
IContextService contextService = (IContextService)editor.getSite().getService(IContextService .*class*);
fContextActivation = contextService.activateContext(EMBEDEDXTEXT_EDITOR_CONTEXT);
}

IHandlerService handlerService = (IHandlerService)PlatformUI.getWorkbench().getAdapter(IHandl erService.*class*);

*for *(ActionHandler actionHandler : fActionHandlers)
{
fHandlerActivations.add(handlerService.activateHandler(actio nHandler.getAction().getId(), actionHandler,
fExpression));
}
}|


I wonder if someone is interested in these minor changes (Cedric?)...

Cheers
/Eike



--------------000904000505080708020201
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Am 16.09.2010 08:45, schrieb Sebastian Zarnekow:
<blockquote cite="mid:i6seep$3gf$1@build.eclipse.org" type="cite">Hi
Eike,
<br>
<br>
did you try the approach that was used here:
<a class="moz-txt-link-freetext" href=" http://code.google.com/a/eclipselabs.org/p/xtext-forms-integ ration/source/browse/#svn/trunk/plugins/org.eclipselabs.xtfo .demo.rcp/src/org/eclipselabs/xtfo/demo/rcp/partialEditing"> http://code.google.com/a/eclipselabs.org/p/xtext-forms-integ ration/source/browse/#svn/trunk/plugins/org.eclipselabs.xtfo .demo.rcp/src/org/eclipselabs/xtfo/demo/rcp/partialEditing</a>
?
<br>
It uses a SourceViewer instead of a full editor and is thereby
more flexible, e.g. you do not need a physical file to edit a
resource.
<br>
</blockquote>
Okay, I've given up on my EditorPart based approach and instead
succeeded to use the code you pointed me to ;-)<br>
<br>
However that code is also not immediately prepared to run outside of
an editor. I had to add some not-null checks:<br>
<br>
<style type="text/css">code { font-family: Courier New,Courier; font-size: 10pt; margin: 0px; }</style>
<div class="java" align="left">
<table bgcolor="#ffffff" border="0" cellpadding="3"
cellspacing="0">
<tbody>
<tr>
<td nowrap="nowrap" align="left" valign="top"> <code>
<font color="#ffffff">


Previous Topic:how to replace literal values by something defined in the grammar?
Next Topic:Limit scoping to a referenced declaration element
Goto Forum:
  


Current Time: Fri Apr 19 21:54:14 GMT 2024

Powered by FUDForum. Page generated in 0.04532 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top