开发者

Eclipse Plugin Development Questions

I´ve got some questions which shouldn´t be hard for a plugin developer.

  • My Plugin should read an INI File and then put the strings into a list. So how do I read a INI File in PDE is there any class? A example code would be amazing.

  • Further on I´m using Grid Layout, but I don´t know how I can control the columns. I have to set it at the beginning with:

layout.numColumns = 3;

But how do I change the row for a added control? (Button first row, text second row, list third row)

  • How can I add when I´m using 开发者_Python百科GridLayout a vertical Scrollbar for my Listbox. It does not work for me in a GridLayout with the following code:

    List listbox = new List(newproject, SWT.BORDER | SWT.SINGLE | SWT.V_SCROLL);

    Rectangle clientArea = getShell().getClientArea ();

    SAFETYVersions.setBounds (clientArea.x, clientArea.y, 100, 100);

I think when I´m using GridLayout i also have to define the size of the listbox?

-Last thing is there a simple checkbox in the widget library from SWT?


About listbox size, try following:

GridData gd = new GridData();
gd.heightHint = 100;
gd.widthHint = 100;
listbox.setLayoutData(gd);

listbox should be in GridLayout, of course.


My Plugin should read an INI File and then put the strings into a list. So how do I read a INI File in PDE is there any class? A example code would be amazing.

Take a look at the IFile interface.

Further on I´m using Grid Layout, but I don´t know how I can control the columns.

You use SWT.PUSH to put the widgets onto the Grid Layout. If layout.numColumns = 3;, that's 3 pushes for each row.

If you want a more complicated layout than a simple grid, you have to use Composites to group the widgets.

Last thing is there a simple checkbox in the widget library from SWT?

Yes, it's a Button with a SWT.CHECK style.


I would recommend you to use a property file instead. Check out the java.util.Properties for more details. You have everything there to help you out.

Drop me a line if you have problems and i will write a quick blog post for this at my blog.

Geirr

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜