Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » what's the best for this case
what's the best for this case [message #237331] Mon, 30 July 2007 12:32 Go to next message
Eclipse UserFriend
Originally posted by: alexjaquet.gmail.com

Hi,

I'm facing the following case, I've to create a new tab page (containing
a text editor) when a user select a certain property from the property
sheet.

What can I use to solve this ? a MultiPageEditPart ? I only get an
abstract edtit part for all my widgets

Thanks for any hints.

Regards

Alexandre
Re: what's the best for this case [message #237337 is a reply to message #237331] Mon, 30 July 2007 14:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alexjaquet.gmail.com

I'm looking to, for a MultiPageEditPage example with source, is there
any avaiable ?

I'm having some question :

If I create a MultiPageEditPage edit part who will manage my
WidgetFigureEditPart and a TextEditorEditPart.

How can I know wich of the two edit part I will add ? How to know that ?
I know I will only play at runtime with my figures and the controller of
the figure is the WidgetEditPart.

How can I create an edit part from a property sheet selection is the
solution of using MultiPageEditPage is good ? Or do I've to implement my
own editor using swt ?

regards
Re: what's the best for this case [message #237343 is a reply to message #237337] Mon, 30 July 2007 15:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alexjaquet.gmail.com

I'm still doing some research and found the following code

http://www.koders.com/java/fid2802F09AFBEC1DB843EA35BF35DE95 9E632208E0.aspx

where createPages make some call to createPage1 ,createPage2 ...

and createPage1 contain the following code

Composite composite = new Composite(getContainer(), SWT.NONE);
GridLayout layout = new GridLayout();
composite.setLayout(layout);
layout.numColumns = 2;
Button fontButton = new Button(composite, SWT.NONE);
GridData gd = new GridData(GridData.BEGINNING);
gd.horizontalSpan = 2;
fontButton.setLayoutData(gd);
fontButton.setText("Change Font...");
fontButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
setFont();
}
});

int index = addPage(composite);
setPageText(index, "Properties");

I'm a bit confused by seen this code, as I thinked it was
it this method I needed to specify the use of the correct edit part.

How can this code know at the runtime that we are working with a certain
widget and use the correct controller.

Thanks
Re: what's the best for this case [message #237354 is a reply to message #237343] Tue, 31 July 2007 06:49 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alexjaquet.gmail.com

I'm trying to implement my MultiPageEditor

public void createDesignPage() {
try {
designer = new WidgetEditPart();
designPageIndex = addPage(designer, getEditorInput());
setPageText(designPageIndex, "Design");
} catch (PartInitException e) {
ErrorDialog.openError(getSite().getShell(), "Error creating Visual
designer", null, e.getStatus());
}
}

The addPage doesn't work because addPage accept only an IEditor where
can I find an edit part who implement the IEditorPart interface

my edit part implements AbstractGraphicalEditPart

thanks for any hints

regards
Re: what's the best for this case [message #237372 is a reply to message #237354] Tue, 31 July 2007 08:04 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alexjaquet.gmail.com

I've changed my code now it's instanciate a PageUIEditor and not an edit
part I made a mistake there.

I created a MultiPageEditorContributor and added the to the plugin.xml
lines :

<editor
default="false"
name="PageUIEditor"
extensions="pagefrag, module, page"
icon="icons/obj16/module.png"
class="com.odcgroup.page.ui.PageUIEditor"
contributorClass="com.odcgroup.page.ui.action.PageUIActionBarContributor "
id="Page Editor">
</editor>
<editor
default="true"
name="MultipageUIEditor"
extensions="pagefrag, module, page"
icon="icons/obj16/module.png"
class="com.odcgroup.page.ui.MultipageUIEditor"
contributorClass="com.odcgroup.page.ui.action.MultiPageEditorContributor "
id="Multi page editor">
</editor>

But when I run my application I see the PageUIEditor and not the
MultipageUIEditor

what do I've missed ?

thanks ...
Re: what's the best for this case [message #237388 is a reply to message #237372] Tue, 31 July 2007 08:29 Go to previous message
Eclipse UserFriend
Originally posted by: alexjaquet.gmail.com

everything work !
Previous Topic:could not resolved type: org.eclipse.ui.texteditor.ITextEditor
Next Topic:Overlapping of figures..
Goto Forum:
  


Current Time: Fri Apr 26 20:10:22 GMT 2024

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

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

Back to the top