Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » MultiPageEditor (once again) and Scrollbars
MultiPageEditor (once again) and Scrollbars [message #289964] Tue, 16 August 2005 03:43 Go to next message
Eclipse UserFriend
Originally posted by: testuser666.arcor.de

Hello, I am developing a plugin using MultiPageEditor example included in
Eclipse. Right from the beginning I kinda misunderstood the concept of
MultiPageEditor (editing one file in several editors), I used it for
presenting three tabed pages, each containing a composite with some widgets
on it, like buttons, input-fields etc., grouped in sections.
Now my rather unexpected (maybe stupid ? ;)) problem:

- when creating those pages in editor, I pass SWT.V_SCROLL, to have a
vertical scrollbar. But... this scrollbar is NOT functioning at all.

Am I missing something? I searched google for many(!) hours, looked through
all mine eclipse-ebooks (quite a few), asked in german forums and still got
no reasonable solution.
Any suggestion would be appreciated! Maybe I have to add a listener or if
it's a dead-end alternative, could anyone suggest another concept to solve
this task.


p.s.: I'm trying to immitate the Layout of plugin.xml-->Overview-Tab, it
would be nice, if someone knows where to look for the sourcecode. Thanks.
Re: MultiPageEditor (once again) and Scrollbars [message #289965 is a reply to message #289964] Tue, 16 August 2005 04:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: testuser666.arcor.de

Here some sourcecode to clarify my question:


Page1.java :

package org.eclipse.ui.examples.multipageeditor;


import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.forms.widgets.ExpandableComposite;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.Section;



public class Page1 extends Composite
{
private Text MappingXML;

private Text RootGroupID;
private Text StructureGroupType;


private final Label MappingXMLLabel;
private final Label RootGroupIDLabel;
private final Label StructureGroupTypeLabel;

private final Section section_1;




/**
* Constructor Constructor
* @param parent Constructor
* @param style
*/
public Page1(Composite parent, int style)
{
// Main
super(parent, style);
FormToolkit toolkit = new FormToolkit(Display.getCurrent());
toolkit.adapt(this);
toolkit.paintBordersFor(this);
setLayout(new GridLayout());

//
// Start
//
// Composite
final Composite composite = toolkit.createComposite(this, SWT.BORDER);
final GridLayout gridLayout_0 = new GridLayout();
gridLayout_0.makeColumnsEqualWidth = true;
gridLayout_0.numColumns = 2;
composite.setLayout(gridLayout_0);
composite.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
toolkit.paintBordersFor(composite);

// MappingXML
this.MappingXMLLabel = toolkit.createLabel(composite, "MappingXML",
SWT.NONE); //$NON-NLS-1$

this.MappingXML = toolkit.createText(composite, null, SWT.BORDER);
this.MappingXML.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
this.MappingXML.setText("");//$NON-NLS-1$

//
// 1. Part
//
// Section 1
section_1 = toolkit.createSection(this, Section.TWISTIE |
ExpandableComposite.EXPANDED | Section.TITLE_BAR);
section_1.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
section_1.setText("GroupStructure ?"); //$NON-NLS-1$

// Composite 1
final Composite composite_1 = toolkit.createComposite(section_1,
SWT.BORDER);
final GridLayout gridLayout_1 = new GridLayout();
gridLayout_1.makeColumnsEqualWidth = true;
gridLayout_1.numColumns = 2;
composite_1.setLayout(gridLayout_1);
section_1.setClient(composite_1);
toolkit.paintBordersFor(composite_1);

// StructureGroupType
this.StructureGroupTypeLabel = toolkit.createLabel(composite_1,
"StructureGroupType", SWT.NONE); //$NON-NLS-1$

this.StructureGroupType = toolkit.createText(composite_1, null,
SWT.BORDER);
this.StructureGroupType.setLayoutData(new
GridData(GridData.FILL_HORIZONTAL));
this.StructureGroupType.setText(""); //$NON-NLS-1$


// RootGroupID
this.RootGroupIDLabel = toolkit.createLabel(composite_1, "RootGroupID ?",
SWT.NONE); //$NON-NLS-1$

this.RootGroupID = toolkit.createText(composite_1, null, SWT.BORDER);
this.RootGroupID.setLayoutData(new
GridData(GridData.HORIZONTAL_ALIGN_FILL));
this.RootGroupID.setText(""); //$NON-NLS-1$



}
}



in MultiPageEditor.java:

import org.eclipse.ui.examples.multipageeditor.Page1;
.......
.......
void createPage3()
{
Composite composite = new Page1(getContainer(),SWT.V_SCROLL);
int index = addPage(composite);
setPageText(index,"Test"); //$NON-NLS-1$

}


/**
* Creates the pages of the multi-page editor.
*/
protected void createPages() {
createPage0();
createPage1();
createPage2();
createPage3();
}
Re: MultiPageEditor (once again) and Scrollbars [message #290166 is a reply to message #289964] Fri, 19 August 2005 07:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rpuschnik.thegoldensource.com

try org.eclipse.swt.custom.ScrolledComposite.

example:

ScrolledComposite myScrolledComposite = new ScrolledComposite(parent,
YOUR_STYLE);

// expand in both directions
myScrolledComposite.setExpandHorizontal(true);
myScrolledComposite.setExpandVertical(true);

// your page
Composite composite = new Page1(myScrolledComposite,SOME_STYLE);

// set content and minimum size
myScrolledComposite.setContent(composite);
myScrolledComposite.setMinSize(composite.computeSize(SWT.DEF AULT,SWT.DEFAULT));

maybe this helps,
robert


Karl Heinz wrote:
> Hello, I am developing a plugin using MultiPageEditor example included in
> Eclipse. Right from the beginning I kinda misunderstood the concept of
> MultiPageEditor (editing one file in several editors), I used it for
> presenting three tabed pages, each containing a composite with some widgets
> on it, like buttons, input-fields etc., grouped in sections.
> Now my rather unexpected (maybe stupid ? ;)) problem:
>
> - when creating those pages in editor, I pass SWT.V_SCROLL, to have a
> vertical scrollbar. But... this scrollbar is NOT functioning at all.
>
> Am I missing something? I searched google for many(!) hours, looked through
> all mine eclipse-ebooks (quite a few), asked in german forums and still got
> no reasonable solution.
> Any suggestion would be appreciated! Maybe I have to add a listener or if
> it's a dead-end alternative, could anyone suggest another concept to solve
> this task.
>
>
> p.s.: I'm trying to immitate the Layout of plugin.xml-->Overview-Tab, it
> would be nice, if someone knows where to look for the sourcecode. Thanks.
>
>
>
>
>
Re: MultiPageEditor (once again) and Scrollbars [message #290199 is a reply to message #290166] Fri, 19 August 2005 17:15 Go to previous message
Eclipse UserFriend
Originally posted by: testuser666.arcor.de

WOW! This worked! Thank you very much, you saved me indeed! Your explanation
was really complete.
Thanks again,

Karl

"Robert Puschnik" <rpuschnik@thegoldensource.com> wrote in message
news:de4061$ao7$1@news.eclipse.org...
> try org.eclipse.swt.custom.ScrolledComposite.
>
> example:
>
> ScrolledComposite myScrolledComposite = new ScrolledComposite(parent,
> YOUR_STYLE);
>
> // expand in both directions
> myScrolledComposite.setExpandHorizontal(true);
> myScrolledComposite.setExpandVertical(true);
>
> // your page
> Composite composite = new Page1(myScrolledComposite,SOME_STYLE);
>
> // set content and minimum size
> myScrolledComposite.setContent(composite);
>
myScrolledComposite.setMinSize(composite.computeSize(SWT.DEF AULT,SWT.DEFAULT
));
>
> maybe this helps,
> robert
>
>
> Karl Heinz wrote:
> > Hello, I am developing a plugin using MultiPageEditor example included
in
> > Eclipse. Right from the beginning I kinda misunderstood the concept of
> > MultiPageEditor (editing one file in several editors), I used it for
> > presenting three tabed pages, each containing a composite with some
widgets
> > on it, like buttons, input-fields etc., grouped in sections.
> > Now my rather unexpected (maybe stupid ? ;)) problem:
> >
> > - when creating those pages in editor, I pass SWT.V_SCROLL, to have a
> > vertical scrollbar. But... this scrollbar is NOT functioning at all.
> >
> > Am I missing something? I searched google for many(!) hours, looked
through
> > all mine eclipse-ebooks (quite a few), asked in german forums and still
got
> > no reasonable solution.
> > Any suggestion would be appreciated! Maybe I have to add a listener or
if
> > it's a dead-end alternative, could anyone suggest another concept to
solve
> > this task.
> >
> >
> > p.s.: I'm trying to immitate the Layout of plugin.xml-->Overview-Tab, it
> > would be nice, if someone knows where to look for the sourcecode.
Thanks.
> >
> >
> >
> >
> >
Previous Topic:getting version of a plugin at runtime
Next Topic:how to deploy plug-in with jar runtime dependencies?
Goto Forum:
  


Current Time: Wed Apr 24 18:27:42 GMT 2024

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

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

Back to the top