Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How to modify text in DSL editor (from code)?
How to modify text in DSL editor (from code)? [message #913487] Sat, 15 September 2012 19:40 Go to next message
Andrew A is currently offline Andrew AFriend
Messages: 9
Registered: June 2012
Junior Member
Hello all!

I need to modify text in my DSL editor (actually - inserting some constant string at the caret position) on a hotkey.

How to do this?

[Updated on: Sat, 15 September 2012 20:39]

Report message to a moderator

Re: How to modify text in DSL editor? [message #913710 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #913720 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #913731 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #913743 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #913755 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #913767 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #913779 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #913791 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #913804 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #913816 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #913830 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #913844 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #913858 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #913872 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #913886 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #913900 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #913914 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #913928 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #913943 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #913963 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #913986 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #914009 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #914033 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #914058 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #914083 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #914108 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #914133 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #914158 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #914183 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #914208 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #914233 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #914258 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #914283 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #914308 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #914333 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #914358 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #914383 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #914408 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #914433 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #914458 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #914483 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #914508 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #914534 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #914560 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #914586 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #914612 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #914638 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #914664 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #914690 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #914716 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #914742 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #914769 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #914796 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #914823 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #914850 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #914874 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #914898 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Re: How to modify text in DSL editor? [message #914920 is a reply to message #913487] Sun, 16 September 2012 01:05 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-15-09 21:40, Andrew A wrote:

> I need to modify text in my DSL editor (actually - inserting some
> constant string) on a hotkey.
>
> How to do this?

You can look at an implementation of a command that is added to a menu
and provides debug output You find it at cloudsmith / geppetto @ github.
Look at this method:

org.cloudsmith.geppetto.pp.dsl.ui.commands.PPDevDebug.execute(ExecutionEvent)

(The rest of the that class is just various actions that I want to
execute from time to time from within the editor - to dump things out -
nothing there except the execute method is relevant for your case).

Also look at how the PPDevDebug is wired into a menu. (You may want some
other binding, using a hotkey, etc.) - there you are on your own - that
is regular Eclipse stuff.

In the execute method, you can figure out what you need from the event
context (i.e. navigate to the editor, the document etc).

Once you have the XtextDocument, you can call it's modify(...) method
which take an instance of an IUnitOfWork. Inside of that you can
manipulate the document - insert, replace, etc.

Hope that helps.

- henrik
Previous Topic:Using generator for corresponding xmi file, not just the xtextual
Next Topic:semantic quick fixes and commens
Goto Forum:
  


Current Time: Thu Mar 28 14:49:00 GMT 2024

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

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

Back to the top