Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Help on Eclipse Forms
Help on Eclipse Forms [message #461944] Thu, 18 January 2007 14:33 Go to next message
Eclipse UserFriend
Originally posted by: jojy.sv.gmail.com

Hi all,

I am trying to use the eclipse forms toolkit in a dialog.

I have created two Sections in the dialog(My dialog class extends dialog)
In each of the sections I am creating some labels toolkit.createLabel...
and formtext as well toolkit.createFormText (...
Now I have lot of data to be displayed in form text
and it is taking several lines.

Now I wanted to add a scroll bar for the section so that I can scroll and
view all the data.

I have used ScrolledForm with TableWrapLayout and corresponding Layoutdata.


Please help

Please find the code below



import java.util.List;

import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.forms.events.ExpansionAdapter;
import org.eclipse.ui.forms.events.ExpansionEvent;
import org.eclipse.ui.forms.widgets.FormText;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.ScrolledForm;
import org.eclipse.ui.forms.widgets.Section;
import org.eclipse.ui.forms.widgets.TableWrapData;
import org.eclipse.ui.forms.widgets.TableWrapLayout;


public class Viewer extends Dialog
{

private Display display = Display.getDefault ();

private FormToolkit toolkit;

private ScrolledForm form;

private String srcPlgID;

private String srcPlgName;

private String tgtPlgID;

private String tgtPlgName;


private String startTag = "<form><p>";

private String endTag = "</p></form>";

private String title;

public Viewer(Shell parentShell)
{
super (parentShell);

}

public Viewer(Shell parentShell, String srcPlgID,
String srcPlgName, String tgtPlgID, String tgtPlgName,
List defaultMappings)
{
super (parentShell);
this.srcPlgID = srcPlgID;
this.srcPlgName = srcPlgName;
this.tgtPlgName = tgtPlgName;
this.tgtPlgID = tgtPlgID;

}

/**
* Adds buttons to this dialog's button bar.
* <p>
* The <code>Dialog</code> implementation of this framework method adds
* standard ok and cancel buttons using the <code>createButton</code>
* framework method. These standard buttons will be accessible from
* <code>getCancelButton</code>, and <code>getOKButton</code>.
* Subclasses may override.
* </p>
*
* @param parent
* the button bar composite
*/
protected void createButtonsForButtonBar (Composite parent)
{
// create OK and Cancel buttons by default
createButton (parent, IDialogConstants.OK_ID,
IDialogConstants.OK_LABEL, true);
}

@Override
protected Control createDialogArea (Composite parent)
{
toolkit = new FormToolkit (display);
form = toolkit.createScrolledForm (parent);

form
.setText ("HEADING");
TableWrapLayout layout = new TableWrapLayout ();
layout.numColumns = 1;
TableWrapData tableWrapData = new TableWrapData
(TableWrapData.FILL);
tableWrapData.grabHorizontal = true;
tableWrapData.maxWidth=display.getBounds ().width;
layout.horizontalSpacing = 10;
layout.verticalSpacing = 5;
layout.numColumns = 1;

form.getBody ().setLayout (layout);
ScrolledForm managedForm = form;


form.getBody ().setLayoutData (tableWrapData);
Composite sourceDetails = createSection (
managedForm,
srcPlgName,
"source ",
2);
Composite targetDetails = createSection (
managedForm,
tgtPlgName,
"taget",
2);
boolean srcpresent = false;
boolean tgtpresent = false;

toolkit.paintBordersFor (form.getBody ());
return parent;
}

private void addFormat (String attributeName, String formatString,
Composite section)
{

createLabel (attributeName +" :", section);

StringBuffer buffer = new StringBuffer (startTag);
String replacedFormat = null;
boolean plain = true;
if (formatString.indexOf ("${") != -1)
{
replacedFormat = formatString.replace ("${",
"<span color=\"bracket\" font=\"bold\">${</span>");
if (replacedFormat.indexOf ("}") != -1)
{
replacedFormat = replacedFormat.replace ("}",
"<span color=\"bracket\" font=\"bold\">}</span>");
plain = false;
}

}
if (null != replacedFormat)
{
buffer.append (replacedFormat);
}
buffer.append (endTag);
if (plain)
{
createLabel (formatString, section);
}
else
{
createFormText (buffer.toString (), section);
}

}

private void createLabel (String string, Composite one)
{

Label lbl = toolkit.createLabel (one, string); //$NON-NLS-1$

TableWrapData td = new TableWrapData (TableWrapData.FILL_GRAB);
td.grabHorizontal = true;
lbl.setLayoutData (td);
lbl.setFont (new Font (null, "sans-serif", 10, SWT.NORMAL));

}

private Composite createFormText (String text, Composite composite)
{

FormText rtext = toolkit.createFormText (composite, true);
rtext.setFont (new Font (null, "sans-serif", 10, SWT.NORMAL));
rtext.setWhitespaceNormalized (true);
TableWrapLayout layout = new TableWrapLayout();

TableWrapData td = new TableWrapData (TableWrapData.FILL_GRAB);
td.grabHorizontal=true;
td.grabHorizontal=true;
rtext.setLayoutData (td);
rtext.setText (text, true, false);
rtext.setFont ("bold", new Font (null, "sans-serif", 10,
SWT.BOLD));
rtext.setColor ("bracket", new Color (null, 139, 0, 139));
return rtext;
}

private Composite createSection (ScrolledForm managedForm, String
title,
String desc, int numColumns)
{
final ScrolledForm form = managedForm;
FormToolkit toolkit = this.toolkit;
Section section = toolkit.createSection (form.getBody (),
Section.TWISTIE | Section.TITLE_BAR | Section.DESCRIPTION
| Section.EXPANDED | SWT.COLOR_DARK_BLUE);
section.setText (title);
section.setDescription (desc);
section.getDescriptionControl ().setFont (
new Font (null, "sans-serif", 12, SWT.NORMAL));


TableWrapLayout layout = new TableWrapLayout ();
layout.topMargin = 0;
layout.numColumns = numColumns;
layout.makeColumnsEqualWidth=true;
TableWrapData tableWrapData = new TableWrapData
(TableWrapData.LEFT);
tableWrapData.grabHorizontal = true;

TableWrapData WrapData = new TableWrapData (TableWrapData.LEFT);
WrapData.grabHorizontal = true;
WrapData.maxWidth=(int) ((display.getBounds ().width)/1.5);
WrapData.maxHeight=(int) ((display.getBounds ().height)/2.5);
section.setLayoutData (WrapData);
Composite client = toolkit.createComposite (section);
client.setLayoutData (tableWrapData);
client.setLayout (layout);
section.setClient (client);
section.addExpansionListener (new ExpansionAdapter () {
public void expansionStateChanged (ExpansionEvent e)
{
form.reflow (true);
}
});
return client;
}

/*
* (non-Javadoc) Method declared in Window.
*/
protected void configureShell (Shell shell)
{
super.configureShell (shell);
if (title != null)
{
shell.setText (title);
}
}

public void setTitle (String title)
{
this.title = title;
}
}
Re: Help on Eclipse Forms [message #461962 is a reply to message #461944] Fri, 19 January 2007 00:02 Go to previous messageGo to next message
Steve Blass is currently offline Steve BlassFriend
Messages: 276
Registered: July 2009
Senior Member
When I load up your example and add lots and lots of text to the section
you placed the word taget in - I get a scroll bar. Maybe all you need
is enough text to run off the page to create a scroll bar?

-
Steve

George S wrote:
> Hi all,
>
> I am trying to use the eclipse forms toolkit in a dialog.
>
> I have created two Sections in the dialog(My dialog class extends dialog)
> In each of the sections I am creating some labels toolkit.createLabel...
> and formtext as well toolkit.createFormText (...
> Now I have lot of data to be displayed in form text
> and it is taking several lines.
>
> Now I wanted to add a scroll bar for the section so that I can scroll
> and view all the data.
>
> I have used ScrolledForm with TableWrapLayout and corresponding Layoutdata.
>
>
> Please help
> Please find the code below
>
>
>
> import java.util.List;
>
> import org.eclipse.jface.dialogs.Dialog;
> import org.eclipse.jface.dialogs.IDialogConstants;
> import org.eclipse.swt.SWT;
> import org.eclipse.swt.custom.ScrolledComposite;
> import org.eclipse.swt.graphics.Color;
> import org.eclipse.swt.graphics.Font;
> import org.eclipse.swt.layout.GridData;
> import org.eclipse.swt.layout.GridLayout;
> import org.eclipse.swt.widgets.Composite;
> import org.eclipse.swt.widgets.Control;
> import org.eclipse.swt.widgets.Display;
> import org.eclipse.swt.widgets.Label;
> import org.eclipse.swt.widgets.Shell;
> import org.eclipse.ui.forms.events.ExpansionAdapter;
> import org.eclipse.ui.forms.events.ExpansionEvent;
> import org.eclipse.ui.forms.widgets.FormText;
> import org.eclipse.ui.forms.widgets.FormToolkit;
> import org.eclipse.ui.forms.widgets.ScrolledForm;
> import org.eclipse.ui.forms.widgets.Section;
> import org.eclipse.ui.forms.widgets.TableWrapData;
> import org.eclipse.ui.forms.widgets.TableWrapLayout;
>
>
> public class Viewer extends Dialog
> {
>
> private Display display = Display.getDefault ();
>
> private FormToolkit toolkit;
>
> private ScrolledForm form;
>
> private String srcPlgID;
>
> private String srcPlgName;
>
> private String tgtPlgID;
>
> private String tgtPlgName;
>
>
> private String startTag = "<form><p>";
>
> private String endTag = "</p></form>";
>
> private String title;
>
> public Viewer(Shell parentShell)
> {
> super (parentShell);
>
> }
>
> public Viewer(Shell parentShell, String srcPlgID,
> String srcPlgName, String tgtPlgID, String tgtPlgName,
> List defaultMappings)
> {
> super (parentShell);
> this.srcPlgID = srcPlgID;
> this.srcPlgName = srcPlgName;
> this.tgtPlgName = tgtPlgName;
> this.tgtPlgID = tgtPlgID;
> }
>
> /**
> * Adds buttons to this dialog's button bar.
> * <p>
> * The <code>Dialog</code> implementation of this framework method adds
> * standard ok and cancel buttons using the <code>createButton</code>
> * framework method. These standard buttons will be accessible from
> * <code>getCancelButton</code>, and <code>getOKButton</code>.
> * Subclasses may override.
> * </p>
> * * @param parent
> * the button bar composite
> */
> protected void createButtonsForButtonBar (Composite parent)
> {
> // create OK and Cancel buttons by default
> createButton (parent, IDialogConstants.OK_ID,
> IDialogConstants.OK_LABEL, true);
> }
>
> @Override
> protected Control createDialogArea (Composite parent)
> {
> toolkit = new FormToolkit (display);
> form = toolkit.createScrolledForm (parent);
>
> form
> .setText ("HEADING");
> TableWrapLayout layout = new TableWrapLayout ();
> layout.numColumns = 1;
> TableWrapData tableWrapData = new TableWrapData
> (TableWrapData.FILL);
> tableWrapData.grabHorizontal = true;
> tableWrapData.maxWidth=display.getBounds ().width;
> layout.horizontalSpacing = 10;
> layout.verticalSpacing = 5;
> layout.numColumns = 1;
>
> form.getBody ().setLayout (layout);
> ScrolledForm managedForm = form;
>
> form.getBody ().setLayoutData (tableWrapData);
> Composite sourceDetails = createSection (
> managedForm,
> srcPlgName,
> "source ",
> 2);
> Composite targetDetails = createSection (
> managedForm,
> tgtPlgName,
> "taget",
> 2);
> boolean srcpresent = false;
> boolean tgtpresent = false;
> toolkit.paintBordersFor (form.getBody ());
> return parent;
> }
>
> private void addFormat (String attributeName, String formatString,
> Composite section)
> {
>
> createLabel (attributeName +" :", section);
> StringBuffer buffer = new StringBuffer (startTag);
> String replacedFormat = null;
> boolean plain = true;
> if (formatString.indexOf ("${") != -1)
> {
> replacedFormat = formatString.replace ("${",
> "<span color=\"bracket\" font=\"bold\">${</span>");
> if (replacedFormat.indexOf ("}") != -1)
> {
> replacedFormat = replacedFormat.replace ("}",
> "<span color=\"bracket\" font=\"bold\">}</span>");
> plain = false;
> }
>
> }
> if (null != replacedFormat)
> {
> buffer.append (replacedFormat);
> }
> buffer.append (endTag);
> if (plain)
> {
> createLabel (formatString, section);
> }
> else
> {
> createFormText (buffer.toString (), section);
> }
>
> }
>
> private void createLabel (String string, Composite one)
> {
>
> Label lbl = toolkit.createLabel (one, string); //$NON-NLS-1$
>
> TableWrapData td = new TableWrapData (TableWrapData.FILL_GRAB);
> td.grabHorizontal = true;
> lbl.setLayoutData (td);
> lbl.setFont (new Font (null, "sans-serif", 10, SWT.NORMAL));
>
> }
>
> private Composite createFormText (String text, Composite composite)
> {
>
> FormText rtext = toolkit.createFormText (composite, true);
> rtext.setFont (new Font (null, "sans-serif", 10, SWT.NORMAL));
> rtext.setWhitespaceNormalized (true);
> TableWrapLayout layout = new TableWrapLayout();
> TableWrapData td = new TableWrapData
> (TableWrapData.FILL_GRAB);
> td.grabHorizontal=true;
> td.grabHorizontal=true;
> rtext.setLayoutData (td);
> rtext.setText (text, true, false);
> rtext.setFont ("bold", new Font (null, "sans-serif", 10, SWT.BOLD));
> rtext.setColor ("bracket", new Color (null, 139, 0, 139));
> return rtext;
> }
>
> private Composite createSection (ScrolledForm managedForm, String title,
> String desc, int numColumns)
> {
> final ScrolledForm form = managedForm;
> FormToolkit toolkit = this.toolkit;
> Section section = toolkit.createSection (form.getBody (),
> Section.TWISTIE | Section.TITLE_BAR | Section.DESCRIPTION
> | Section.EXPANDED | SWT.COLOR_DARK_BLUE);
> section.setText (title);
> section.setDescription (desc);
> section.getDescriptionControl ().setFont (
> new Font (null, "sans-serif", 12, SWT.NORMAL));
>
> TableWrapLayout layout = new TableWrapLayout ();
> layout.topMargin = 0;
> layout.numColumns = numColumns;
> layout.makeColumnsEqualWidth=true;
> TableWrapData tableWrapData = new TableWrapData
> (TableWrapData.LEFT);
> tableWrapData.grabHorizontal = true;
> TableWrapData WrapData = new TableWrapData
> (TableWrapData.LEFT);
> WrapData.grabHorizontal = true;
> WrapData.maxWidth=(int) ((display.getBounds ().width)/1.5);
> WrapData.maxHeight=(int) ((display.getBounds ().height)/2.5);
> section.setLayoutData (WrapData);
> Composite client = toolkit.createComposite (section);
> client.setLayoutData (tableWrapData);
> client.setLayout (layout);
> section.setClient (client);
> section.addExpansionListener (new ExpansionAdapter () {
> public void expansionStateChanged (ExpansionEvent e)
> {
> form.reflow (true);
> }
> });
> return client;
> }
>
> /*
> * (non-Javadoc) Method declared in Window.
> */
> protected void configureShell (Shell shell)
> {
> super.configureShell (shell);
> if (title != null)
> {
> shell.setText (title);
> }
> }
>
> public void setTitle (String title)
> {
> this.title = title;
> }
> }
>
>
Re: Help on Eclipse Forms [message #461972 is a reply to message #461962] Fri, 19 January 2007 12:39 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jojy.sv.gmail.com

Hi Steve,

I think I am trying to do something different.

If I set a lengthy description I am able to get a scroll bar.

Here I am trying to create a new Composite as the child of of Section and
it that composite I have created four toolkit.createLabel(... and four
toolkit.createFormText (...

Now I am trying to increase the text length for the FormText to a greater
value then the size of the Dialog increases but does not display a
vertical/horizontal scrollbar


Is there any way of creating scroll bar so that I can scroll Formlabels
one by one


Regards
George S
Steve Blass wrote:

> When I load up your example and add lots and lots of text to the section
> you placed the word taget in - I get a scroll bar. Maybe all you need
> is enough text to run off the page to create a scroll bar?

> -
> Steve

> George S wrote:
>> Hi all,
>>
>> I am trying to use the eclipse forms toolkit in a dialog.
>>
>> I have created two Sections in the dialog(My dialog class extends dialog)
>> In each of the sections I am creating some labels toolkit.createLabel...
>> and formtext as well toolkit.createFormText (...
>> Now I have lot of data to be displayed in form text
>> and it is taking several lines.
>>
>> Now I wanted to add a scroll bar for the section so that I can scroll
>> and view all the data.
>>
>> I have used ScrolledForm with TableWrapLayout and corresponding Layoutdata.
>>
>>
>> Please help
>> Please find the code below
>>
>>
>>
>> import java.util.List;
>>
>> import org.eclipse.jface.dialogs.Dialog;
>> import org.eclipse.jface.dialogs.IDialogConstants;
>> import org.eclipse.swt.SWT;
>> import org.eclipse.swt.custom.ScrolledComposite;
>> import org.eclipse.swt.graphics.Color;
>> import org.eclipse.swt.graphics.Font;
>> import org.eclipse.swt.layout.GridData;
>> import org.eclipse.swt.layout.GridLayout;
>> import org.eclipse.swt.widgets.Composite;
>> import org.eclipse.swt.widgets.Control;
>> import org.eclipse.swt.widgets.Display;
>> import org.eclipse.swt.widgets.Label;
>> import org.eclipse.swt.widgets.Shell;
>> import org.eclipse.ui.forms.events.ExpansionAdapter;
>> import org.eclipse.ui.forms.events.ExpansionEvent;
>> import org.eclipse.ui.forms.widgets.FormText;
>> import org.eclipse.ui.forms.widgets.FormToolkit;
>> import org.eclipse.ui.forms.widgets.ScrolledForm;
>> import org.eclipse.ui.forms.widgets.Section;
>> import org.eclipse.ui.forms.widgets.TableWrapData;
>> import org.eclipse.ui.forms.widgets.TableWrapLayout;
>>
>>
>> public class Viewer extends Dialog
>> {
>>
>> private Display display = Display.getDefault ();
>>
>> private FormToolkit toolkit;
>>
>> private ScrolledForm form;
>>
>> private String srcPlgID;
>>
>> private String srcPlgName;
>>
>> private String tgtPlgID;
>>
>> private String tgtPlgName;
>>
>>
>> private String startTag = "<form><p>";
>>
>> private String endTag = "</p></form>";
>>
>> private String title;
>>
>> public Viewer(Shell parentShell)
>> {
>> super (parentShell);
>>
>> }
>>
>> public Viewer(Shell parentShell, String srcPlgID,
>> String srcPlgName, String tgtPlgID, String tgtPlgName,
>> List defaultMappings)
>> {
>> super (parentShell);
>> this.srcPlgID = srcPlgID;
>> this.srcPlgName = srcPlgName;
>> this.tgtPlgName = tgtPlgName;
>> this.tgtPlgID = tgtPlgID;
>> }
>>
>> /**
>> * Adds buttons to this dialog's button bar.
>> * <p>
>> * The <code>Dialog</code> implementation of this framework method adds
>> * standard ok and cancel buttons using the <code>createButton</code>
>> * framework method. These standard buttons will be accessible from
>> * <code>getCancelButton</code>, and <code>getOKButton</code>.
>> * Subclasses may override.
>> * </p>
>> * * @param parent
>> * the button bar composite
>> */
>> protected void createButtonsForButtonBar (Composite parent)
>> {
>> // create OK and Cancel buttons by default
>> createButton (parent, IDialogConstants.OK_ID,
>> IDialogConstants.OK_LABEL, true);
>> }
>>
>> @Override
>> protected Control createDialogArea (Composite parent)
>> {
>> toolkit = new FormToolkit (display);
>> form = toolkit.createScrolledForm (parent);
>>
>> form
>> .setText ("HEADING");
>> TableWrapLayout layout = new TableWrapLayout ();
>> layout.numColumns = 1;
>> TableWrapData tableWrapData = new TableWrapData
>> (TableWrapData.FILL);
>> tableWrapData.grabHorizontal = true;
>> tableWrapData.maxWidth=display.getBounds ().width;
>> layout.horizontalSpacing = 10;
>> layout.verticalSpacing = 5;
>> layout.numColumns = 1;
>>
>> form.getBody ().setLayout (layout);
>> ScrolledForm managedForm = form;
>>
>> form.getBody ().setLayoutData (tableWrapData);
>> Composite sourceDetails = createSection (
>> managedForm,
>> srcPlgName,
>> "source ",
>> 2);
>> Composite targetDetails = createSection (
>> managedForm,
>> tgtPlgName,
>> "taget",
>> 2);
>> boolean srcpresent = false;
>> boolean tgtpresent = false;
>> toolkit.paintBordersFor (form.getBody ());
>> return parent;
>> }
>>
>> private void addFormat (String attributeName, String formatString,
>> Composite section)
>> {
>>
>> createLabel (attributeName +" :", section);
>> StringBuffer buffer = new StringBuffer (startTag);
>> String replacedFormat = null;
>> boolean plain = true;
>> if (formatString.indexOf ("${") != -1)
>> {
>> replacedFormat = formatString.replace ("${",
>> "<span color="bracket" font="bold">${</span>");
>> if (replacedFormat.indexOf ("}") != -1)
>> {
>> replacedFormat = replacedFormat.replace ("}",
>> "<span color="bracket" font="bold">}</span>");
>> plain = false;
>> }
>>
>> }
>> if (null != replacedFormat)
>> {
>> buffer.append (replacedFormat);
>> }
>> buffer.append (endTag);
>> if (plain)
>> {
>> createLabel (formatString, section);
>> }
>> else
>> {
>> createFormText (buffer.toString (), section);
>> }
>>
>> }
>>
>> private void createLabel (String string, Composite one)
>> {
>>
>> Label lbl = toolkit.createLabel (one, string); //$NON-NLS-1$
>>
>> TableWrapData td = new TableWrapData (TableWrapData.FILL_GRAB);
>> td.grabHorizontal = true;
>> lbl.setLayoutData (td);
>> lbl.setFont (new Font (null, "sans-serif", 10, SWT.NORMAL));
>>
>> }
>>
>> private Composite createFormText (String text, Composite composite)
>> {
>>
>> FormText rtext = toolkit.createFormText (composite, true);
>> rtext.setFont (new Font (null, "sans-serif", 10, SWT.NORMAL));
>> rtext.setWhitespaceNormalized (true);
>> TableWrapLayout layout = new TableWrapLayout();
>> TableWrapData td = new TableWrapData
>> (TableWrapData.FILL_GRAB);
>> td.grabHorizontal=true;
>> td.grabHorizontal=true;
>> rtext.setLayoutData (td);
>> rtext.setText (text, true, false);
>> rtext.setFont ("bold", new Font (null, "sans-serif", 10, SWT.BOLD));
>> rtext.setColor ("bracket", new Color (null, 139, 0, 139));
>> return rtext;
>> }
>>
>> private Composite createSection (ScrolledForm managedForm, String title,
>> String desc, int numColumns)
>> {
>> final ScrolledForm form = managedForm;
>> FormToolkit toolkit = this.toolkit;
>> Section section = toolkit.createSection (form.getBody (),
>> Section.TWISTIE | Section.TITLE_BAR | Section.DESCRIPTION
>> | Section.EXPANDED | SWT.COLOR_DARK_BLUE);
>> section.setText (title);
>> section.setDescription (desc);
>> section.getDescriptionControl ().setFont (
>> new Font (null, "sans-serif", 12, SWT.NORMAL));
>>
>> TableWrapLayout layout = new TableWrapLayout ();
>> layout.topMargin = 0;
>> layout.numColumns = numColumns;
>> layout.makeColumnsEqualWidth=true;
>> TableWrapData tableWrapData = new TableWrapData
>> (TableWrapData.LEFT);
>> tableWrapData.grabHorizontal = true;
>> TableWrapData WrapData = new TableWrapData
>> (TableWrapData.LEFT);
>> WrapData.grabHorizontal = true;
>> WrapData.maxWidth=(int) ((display.getBounds ().width)/1.5);
>> WrapData.maxHeight=(int) ((display.getBounds ().height)/2.5);
>> section.setLayoutData (WrapData);
>> Composite client = toolkit.createComposite (section);
>> client.setLayoutData (tableWrapData);
>> client.setLayout (layout);
>> section.setClient (client);
>> section.addExpansionListener (new ExpansionAdapter () {
>> public void expansionStateChanged (ExpansionEvent e)
>> {
>> form.reflow (true);
>> }
>> });
>> return client;
>> }
>>
>> /*
>> * (non-Javadoc) Method declared in Window.
>> */
>> protected void configureShell (Shell shell)
>> {
>> super.configureShell (shell);
>> if (title != null)
>> {
>> shell.setText (title);
>> }
>> }
>>
>> public void setTitle (String title)
>> {
>> this.title = title;
>> }
>> }
>>
>>
Re: Help on Eclipse Forms [message #461984 is a reply to message #461972] Fri, 19 January 2007 17:44 Go to previous messageGo to next message
Steve Blass is currently offline Steve BlassFriend
Messages: 276
Registered: July 2009
Senior Member
George,

I don't know for sure how to get the effect you're looking for. Perhaps
a dialog with multiple scrolled forms could work.

-
Steve


George S wrote:
> Hi Steve,
>
> I think I am trying to do something different.
>
> If I set a lengthy description I am able to get a scroll bar.
>
> Here I am trying to create a new Composite as the child of of Section
> and it that composite I have created four toolkit.createLabel(... and
> four toolkit.createFormText (...
>
> Now I am trying to increase the text length for the FormText to a
> greater value then the size of the Dialog increases but does not
> display a vertical/horizontal scrollbar
>
>
> Is there any way of creating scroll bar so that I can scroll Formlabels
> one by one
>
> Regards
> George S
> Steve Blass wrote:
>
>> When I load up your example and add lots and lots of text to the
>> section you placed the word taget in - I get a scroll bar. Maybe
>> all you need is enough text to run off the page to create a scroll bar?
>
>> -
>> Steve
>
Re: Help on Eclipse Forms [message #461995 is a reply to message #461984] Sat, 20 January 2007 16:37 Go to previous message
Eclipse UserFriend
Originally posted by: jojy.sv.gmail.com

I am trying with scrolled composite now
Previous Topic:IDE inconstencies running different plugin-projects
Next Topic:lo4j properties with RCP and Spring
Goto Forum:
  


Current Time: Sun May 05 12:09:40 GMT 2024

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

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

Back to the top