what's the best for this case [message #237331] |
Mon, 30 July 2007 12:32 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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 ...
|
|
|
|
Powered by
FUDForum. Page generated in 0.03007 seconds