Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » MultiPageEditorPart
icon5.gif  MultiPageEditorPart [message #654228] Mon, 14 February 2011 16:44 Go to next message
spcmdr is currently offline spcmdrFriend
Messages: 15
Registered: January 2011
Junior Member
Hi

I need help to create an editor with multiple pages.
I am using a MultiPageEditorPart.
The editor will edit xml content like this

<product>
--<description>(#PCDATA)</description>
--<properties>
----<property name="xxx" values="yyy">
----<property name="xxx" values="yyy">
--</properties>
</product>

I want:
The first page to edit the description's content
The second page to edit the properties

I am using a text editor for the first page and a composite with table for the second page.

My questions are:

> In the composite How to programmaly tells that the content have changed?
> In the first page how to edit only the description directly (the text editor receives a file and output the whole xml)?



[Updated on: Mon, 14 February 2011 16:45]

Report message to a moderator

Re: MultiPageEditorPart [message #655019 is a reply to message #654228] Fri, 18 February 2011 01:34 Go to previous message
spcmdr is currently offline spcmdrFriend
Messages: 15
Registered: January 2011
Junior Member
Hi

I found a solution to notify the MultiPageEditorPart that an editor have been updated.

In the composite, use EditorPart as parent class and add this code.

public class CompositeEditor extends EditorPart
{
	private boolean dirty = false;

	@Override
	public boolean isDirty()
	{
		return dirty;
	}

	/**
	 * set the dirty
	 * @param dirty {@link boolean} the dirty to set
	 */
	public void setDirty(boolean dirty)
	{
		this.dirty = dirty;
		firePropertyChange(IWorkbenchPartConstants.PROP_DIRTY);
	}
}


Use the method setDirty(boolean dirty), each fime the editor content change.


Regards
Previous Topic:Decoration questions
Next Topic:Adding an existing menu to a context menu
Goto Forum:
  


Current Time: Thu Nov 27 00:45:39 GMT 2014

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

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