some general window builder questions - part 2

SWT Designer allows you to create the views, editors, perspectives, pref pages, composites, etc. that comprise Eclipse SWT & RCP applications and plug-ins.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

some general window builder questions - part 2

Postby TEMP USER » Tue Dec 01, 2009 12:16 am

hi,

from some reason, my previous thread was locked before i could even reply it:
viewtopic.php?f=1&t=2723&start=60
and i can't find how to PM whoever done it.

anyway, my reply is:
Whether you can click on the composite and drag it in the design view depends on what layout it has and how much white space there is to grab on to. You would need to click somewhere not occupied by one of its children. This is quite easy to do if the composite is using a GridLayout or null layout, for example. In the extreme case where you have a FillLayout and the child completely fills the composite, you would need to select the composite in the tree. Once the composite has focus, you can drag it by one of its edges to another cell.

-what? why not treat the composite just like any other component, so it could move freely on the gridLayout ?

You can reveal any child of a StackLayout by clicking on it in the component tree. The child that is showing can then be edited in the design view.

-that doesn't work. maybe it has something to do with the fact that on one of them i have a JOGL component via AWT ?

i also have some suggestions, since i've learned some C# recently , using Visual Studio 2008 . i found there some really cool stuff, that i wish we could have on window builder too :
1.on VS2008 , there is full seperation between the events and the design of the window. not only that, but the GUI components are seperated as well, by comments with their names.i wish we could do something like that automatically on window-builder too. on Window builder, everything is merged into one file, so we have a mess and it's easy to have bugs, even if all you did is just moving a button in the design view.
2.on VS2008 , you can see all of the available events of a control via a window that is also used for viewing the properties of it. also, all of the events that are already used are marked there and are shown with their full name.you can also sort by alphabet and in categorized view , for both the events and the properties. on window builder , we have to right click on the component instead, and look for the desired event by ourselves.
3.when there is a situation of a component behind another , VS2008 allows you to choose the one you wanted, by right clicking on this area and choose which component you wish to choose.on windowBuilder, you have to find which of them you want to choose, via the tree of the GUI components.
4.you can see the code of a specific component by right clicking on it and press 'view code' . this is quite odd on VS2008 , since what it does is showing the code of the default event of this component. i would suggest having a menu of what code of the object to show - each of the events of it, and also the design code of it. windowBuilder has it for the events, but not for the properties of the object.
TEMP USER
 
Posts: 60
Joined: Mon Jun 01, 2009 2:46 am

Re: some general window builder questions - part 2

Postby Eric Clayberg » Tue Dec 01, 2009 5:25 am

TEMP USER wrote:from some reason, my previous thread was locked before i could even reply it

That thread was left open for more than a week after the last post...more than enough time for a reply. When no reply was posted, that thread was locked intentionally as it had become far too long and disjointed. In the future, please start a new thread for each new topic you wish to discuss rather than reopening an older thread on a different topic. Use a thread title appropriate to the topic as well. We will also be more proactive about splitting threads that switch topics.

TEMP USER wrote:why not treat the composite just like any other component, so it could move freely on the gridLayout ?

Composites are treated just like any other component and can be moved freely within a GridLayout. Composites, however, can have their own layout and children. If you click on the child of a Composite (rather than the Composite), you will end up moving that child rather than its parent. I explained to you a technique you can use to still move the Composite even if one of its children fills it completely.

TEMP USER wrote:that doesn't work. maybe it has something to do with the fact that on one of them i have a JOGL component via AWT ?

Please provide an example where it does not work.

TEMP USER wrote:1.on VS2008 , there is full seperation between the events and the design of the window. not only that, but the GUI components are seperated as well, by comments with their names.i wish we could do something like that automatically on window-builder too.

What would their names be? Their text labels? Variable names? What if they aren't assigned to a variable?

TEMP USER wrote:on Window builder, everything is merged into one file, so we have a mess and it's easy to have bugs, even if all you did is just moving a button in the design view.

I disagree.

TEMP USER wrote:2.on VS2008 , you can see all of the available events of a control via a window that is also used for viewing the properties of it. also, all of the events that are already used are marked there and are shown with their full name.you can also sort by alphabet and in categorized view , for both the events and the properties. on window builder , we have to right click on the component instead, and look for the desired event by ourselves.

That is certainly one way to do it, but not the only way. You can see all of the events listed in the property pane very easily by clicking the "Show Events" button... Image

Image

TEMP USER wrote:3.when there is a situation of a component behind another , VS2008 allows you to choose the one you wanted, by right clicking on this area and choose which component you wish to choose.on windowBuilder, you have to find which of them you want to choose, via the tree of the GUI components.

Are you referring to a StackLayout or something else? Typically, components should not overlap.

TEMP USER wrote:4.you can see the code of a specific component by right clicking on it and press 'view code' . this is quite odd on VS2008 , since what it does is showing the code of the default event of this component. i would suggest having a menu of what code of the object to show - each of the events of it, and also the design code of it. windowBuilder has it for the events, but not for the properties of the object.

Click the "Goto Definition" button... Image
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: some general window builder questions - part 2

Postby TEMP USER » Sat Dec 05, 2009 8:49 pm

That thread was left open for more than a week after the last post...more than enough time for a reply. When no reply was posted, that thread was locked intentionally as it had become far too long and disjointed. In the future, please start a new thread for each new topic you wish to discuss rather than reopening an older thread on a different topic. Use a thread title appropriate to the topic as well. We will also be more proactive about splitting threads that switch topics.

-that's the first time I've seen such a reaction at a forum for an old post. i don't have a lot of spare time lately and this is why i didn't post for a long time.

Composites are treated just like any other component and can be moved freely within a GridLayout. Composites, however, can have their own layout and children. If you click on the child of a Composite (rather than the Composite), you will end up moving that child rather than its parent. I explained to you a technique you can use to still move the Composite even if one of its children fills it completely.

if you mean the technique of having the focus on the composite, it doesn't work for moving it, only work for resizing using the green and black markers.

Please provide an example where it does not work.

composite with glframe (java.awt.Frame) in it, with a canvas (GLCanvas) in the glframe.

What would their names be? Their text labels? Variable names? What if they aren't assigned to a variable?

just like adding new buttons on windowBuilder . if you add a new label, its name and text would be "label1" (if non exist) , then if you add a new one, its name and text would be "label2" . the design code would look something like ("..." mean real code automatically created by VS , yet chosen by the programmer) :

//
// label1
//
...
//
// label2
//
...

if you double clicked on label1's "Click" event, a new event will be created in the events file, which will look like this:
private void label1_Click(object sender,EventArgs e)
{
}

I disagree.

well , i find it very odd, since you seem to have a totally different approach about the forum:
"In the future, please start a new thread for each new topic you wish to discuss rather than reopening an older thread on a different topic. Use a thread title appropriate to the topic as well. We will also be more proactive about splitting threads that switch topics"
i didn't separate the topics only because lack of spare time.however, separating design from events is very comfortable, and will always reduce working time (think of the needed scrolling for finding where to change things, and of the bugs that pop up when you have such a long code) .

That is certainly one way to do it, but not the only way. You can see all of the events listed in the property pane very easily by clicking the "Show Events" button...

cool! can i also remove the categories, and sort by alphabet (of the events and/or of the properties) ?

Are you referring to a StackLayout or something else? Typically, components should not overlap.

not necessary . for example, when you have a composite which contain another object in it, or even when you have a shell with something in it. you should always be able to choose the shell , even if its entire area is used by other components.

Click the "Goto Definition" button...

OK .could still be nicer if it was more accessible, using the context menu , with some more options on what to show exactly.
TEMP USER
 
Posts: 60
Joined: Mon Jun 01, 2009 2:46 am

Re: some general window builder questions - part 2

Postby Eric Clayberg » Sun Dec 06, 2009 3:18 pm

TEMP USER wrote:that's the first time I've seen such a reaction at a forum for an old post.

We have split many posts in the past when they changed topics. That thread was all over the map and covered lots of different topics. We should have tried to split it apart earlier, but it finally got so long that it needed to be closed off.

TEMP USER wrote:i don't have a lot of spare time lately and this is why i didn't post for a long time.

In that case, it was a perfect time to close that thread off.

TEMP USER wrote:if you mean the technique of having the focus on the composite, it doesn't work for moving it, only work for resizing using the green and black markers.

Not true. It also works for moving it as long as you drag it by the edge (when the 4-way arrow is showing).

TEMP USER wrote:composite with glframe (java.awt.Frame) in it, with a canvas (GLCanvas) in the glframe

I'm not familiar with those classes, but I did try it with various standard Swing classes, and it worked fine.

TEMP USER wrote:if you double clicked on label1's "Click" event, a new event will be created in the events file, which will look like this

Have you tried turning on the Create stub event handler methods preference?

TEMP USER wrote:i find it very odd, since you seem to have a totally different approach about the forum

Those are completely unrelated concepts.

TEMP USER wrote:i didn't separate the topics only because lack of spare time

As I said, we will be more proactive in doing so in the future.

TEMP USER wrote:separating design from events is very comfortable

You can easily separate your design from your actual event handling code using the Create stub event handler methods option.

TEMP USER wrote:think of the needed scrolling for finding where to change things, and of the bugs that pop up when you have such a long code

I don't typically modify the code that defines the UI by hand; I let the design view do that, so I don't really care how long that method is. I can also refactor it if necessary - and often do in order to construct visual inheritance hierarchies.

TEMP USER wrote:can i also remove the categories, and sort by alphabet (of the events and/or of the properties) ?

No. There is no option to do that. The event categories are already sorted for you.

TEMP USER wrote:when you have a composite which contain another object in it, or even when you have a shell with something in it. you should always be able to choose the shell , even if its entire area is used by other components.

If you have a child filling a parent, you can easily select its parent in the tree or you can also hit the ESC key to jump the selection to the parent. Hit ESC repeatedly, and you will end up at the root object.

TEMP USER wrote:could still be nicer if it was more accessible, using the context menu

Isn't a toolbar button that is always visible more accessible than a context menu? BTW, the "Goto Definition" command is on the context menu of the property pane as well.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: some general window builder questions - part 2

Postby TEMP USER » Mon Dec 07, 2009 8:21 am

We have split many posts in the past when they changed topics. That thread was all over the map and covered lots of different topics. We should have tried to split it apart earlier, but it finally got so long that it needed to be closed off...In that case, it was a perfect time to close that thread off.

what? why? i try my best to come back at least once a week. why would you want to close a topic that i couldn't even have the chance to reply or ask questions? it doesn't have any logic.

Not true. It also works for moving it as long as you drag it by the edge (when the 4-way arrow is showing)...I'm not familiar with those classes, but I did try it with various standard Swing classes, and it worked fine.

well , this is correct only if i drag it by the edge, but not when the mouse is inside its area, while it contains other GUI objects.

Have you tried turning on the Create stub event handler methods preference?You can easily separate your design from your actual event handling code using the Create stub event handler methods option.

no, i haven't(thought it's only for auto-renaming events) , and now i tried it and it's really cool(also the part where you can customize it) . however, this is only a part of what i waas talking about.for creating a new event, the interface part takes about 8 lines for just adding it, instead of just declaring the event handler in the file(meaning just one line), and then implementing it in the appropriate function.look what's happening:
Code: Select all
button.addSelectionListener(new SelectionAdapter()
      {
        @Override
        public void widgetSelected(SelectionEvent e)
          {
          button_widgetSelected(e);
          }
      });
...
protected static void button_widgetSelected(SelectionEvent e)
    {
   
    }


Those are completely unrelated concepts.

-yes, but the idea is the same.you like diving subjects and handeling them one at a time, the same as i do.

As I said, we will be more proactive in doing so in the future.

-sorry.

I don't typically modify the code that defines the UI by hand; I let the design view do that, so I don't really care how long that method is. I can also refactor it if necessary - and often do in order to construct visual inheritance hierarchies.

windowBuilder can't do everything. you always have to write something in the events handler, and it's best to let windowBuilder do the part it's good at (meaning GUI properties etc ) in its own file,while we the developers mainly edit the events handlers.

No. There is no option to do that. The event categories are already sorted for you.

that i noticed. what i asked for is an option to remove the categories, while putting all of the events sorted , and also maybe allow us to type text to find the specific event we are looking for .

If you have a child filling a parent, you can easily select its parent in the tree or you can also hit the ESC key to jump the selection to the parent. Hit ESC repeatedly, and you will end up at the root object.

those are still only good tips, but not what i was thinking about.

Isn't a toolbar button that is always visible more accessible than a context menu? BTW, the "Goto Definition" command is on the context menu of the property pane as well.

no, because a context menu is much closer to the mouse cursor, and it can also have a submenu to choose exacly what to show.also, about the properties pane, that's where i found it. where did you mean that it's located? anyway, what i meant is that this would be in the context menu of each GUI object:
Image
and that we could choose exactly what code to show :declaration,interface, event1,event2 ,... .
TEMP USER
 
Posts: 60
Joined: Mon Jun 01, 2009 2:46 am

Re: some general window builder questions - part 2

Postby Eric Clayberg » Wed Dec 09, 2009 8:33 pm

TEMP USER wrote:why would you want to close a topic that i couldn't even have the chance to reply or ask questions?

The problem with that thread was that you repeatedly kept restarting it with new questions unrelated to the original topic...in effect using it as your own private sandbox. At one point, you restarted it three months after the last post. We waited well over a week to give you an opportunity to respond to that thread. Since you did not, we decided to lock down that thread to prevent it from being re-opened again with a different set of questions. Please keep each thread limited to one topic or closely related set of questions. If you have new questions, start a new thread and use an informative title.

TEMP USER wrote:this is correct only if i drag it by the edge, but not when the mouse is inside its area, while it contains other GUI objects.

As I explained, it is only intended to work when dragged from the edge. If you click on the child and start dragging, you will drag the child, not the parent. This makes it easy to drag either depending on your intent.

TEMP USER wrote:for creating a new event, the interface part takes about 8 lines for just adding it

That depends on the Event code generation style you have selected. Choose Create inner class, and it will only take one line.

TEMP USER wrote:you always have to write something in the events handler

Which is one of the reasons we added the Create stub event handler methods option.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: some general window builder questions - part 2

Postby TEMP USER » Tue Dec 15, 2009 11:34 am

The problem with that thread ...

-3 months of inactivity doesn't mean i can't have any new questions, and putting a single question per thread will flood the forum and will make it harder for both you and me to manage and monitor them all . i prefer to ask a bunch of questions in the same thread since i rarely visit the forum anyway. about the title, it doesn't matter, since the searching mechanism of the forum allows to search the content of the threads too.plus, usually the question relate to the same general topic.again, sorry for not having enough time for doing it.

As I explained, it is only intended to work when dragged from the edge. If you click on the child and start dragging, you will drag the child, not the parent. This makes it easy to drag either depending on your intent.

-well that's another reason why this should be considered as a request.

That depends on the Event code generation style you have selected. Choose Create inner class, and it will only take one line.

that looks much much better.only thing i would miss now is having the events in a different file.in addition, why didn't it make the event name look like this:
${component_name}_${event_name}
even though i've set it this way?
TEMP USER
 
Posts: 60
Joined: Mon Jun 01, 2009 2:46 am

Re: some general window builder questions - part 2

Postby Eric Clayberg » Wed Dec 16, 2009 8:06 am

TEMP USER wrote:-3 months of inactivity doesn't mean i can't have any new questions

If you have direct follow-up questions related to an existing thread, that is generally OK. Re-opening an old thread by adding new and unrelated questions to it is never OK.

TEMP USER wrote:putting a single question per thread will flood the forum and will make it harder for both you and me to manage and monitor them all

A single question or set of closely related questions per thread with an informative title makes the forum much easier to manage and monitor and much easier for other users to benefit from it. Threads also need to be kept to a manageable length. When a thread grows to dozens of posts, it becomes very difficult for anyone to follow.

TEMP USER wrote:i prefer to ask a bunch of questions in the same thread since i rarely visit the forum anyway.

Keep your questions related to the topic, and it won't be a problem. If you have a new topic or set of questions unrelated to the questions asked in the existing thread, start a new thread. That is just common courtesy for any forum.

TEMP USER wrote:about the title, it doesn't matter, since the searching mechanism of the forum allows to search the content of the threads too

The thread titles matter a great deal as those are the only things immediately visible when a user visits the forum. A user can quickly decide whether a particular topic is of interest to them or not. Likewise, our support staff can more easily determine whether a particular question falls into their area for review. A generic title that conveys nothing about the topic is waste of time for everyone.

TEMP USER wrote:usually the question relate to the same general topic.

The general topic of this forum is SWT Designer, so I hope that any questions would be related to that. As your questions are dealing with some specific sub topic relevant to the forum, please try to come up with a relevant title.

TEMP USER wrote:again, sorry for not having enough time for doing it.

Given that we gave you this license for free for use with your open source project, and that you were using the product for "free" long before that (and I use that term quite loosely), and that all of the support we are providing you is equally for free, I would hope that you would be more willing to find the time to play by our rules. Or should I consider your original usage of our product to be indicative of your (un)willingness to do so?

TEMP USER wrote:in addition, why didn't it make the event name look like this:
${component_name}_${event_name}
even though i've set it this way?

The template applies to stub event handler methods rather than inner class names. Inner classes have always been generated using the pattern ${Component_name}${listenerTypeName}. In the latest build, this pattern can now be configured.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: some general window builder questions - part 2

Postby TEMP USER » Fri Dec 25, 2009 12:29 am

...

well in the beginning nobody told me that it's making anyone angry .there are still so much to learn of this tool . only thing i can do for now is to ask one question at a time, and i will try to make it as simple as possible , so that the answer will be short and right after the question post , and it won't make anyone here anxious of managing the forum.

Given that we gave you this license for free for use with your open source project, and that you were using the product for "free" long before that (and I use that term quite loosely), and that all of the support we are providing you is equally for free, I would hope that you would be more willing to find the time to play by our rules. Or should I consider your original usage of our product to be indicative of your (un)willingness to do so?

-what? i used the product for a very brief time, as the trial allowed me to(rest was done manually). as a student, i can't afford buying this product, especially if i didn't use it enough to justify the buying of it. i even registered without knowing what it means (in terms of what it will help) , so that maybe i will have more features/time to use it.for all that matter, i think that such a tool should be inside every IDE product , because it's that important . maybe Sun should buy your company.

The template applies to stub event handler methods rather than inner class names. Inner classes have always been generated using the pattern ${Component_name}${listenerTypeName}. In the latest build, this pattern can now be configured.

ok, so i guess it's now ok.

i have a new question:
you told me before, that i need to change the file "eclipse.ini" so that it will have in the end:
-Duser.home=D:/eclipse/
however, since i'm sometimes on the move, i put the Eclipse and the workspace files with me on diskonkey (without putting the files in another computer, don't worry) . since different computers have a different letter for the diskonkey, i can't choose the same letter for all of them. what should i use?
TEMP USER
 
Posts: 60
Joined: Mon Jun 01, 2009 2:46 am

Re: some general window builder questions - part 2

Postby Eric Clayberg » Fri Dec 25, 2009 5:28 pm

TEMP USER wrote:you told me before, that i need to change the file "eclipse.ini" so that it will have in the end:
-Duser.home=D:/eclipse/
however, since i'm sometimes on the move, i put the Eclipse and the workspace files with me on diskonkey (without putting the files in another computer, don't worry) . since different computers have a different letter for the diskonkey, i can't choose the same letter for all of them. what should i use?

I don't know. What have you tried?

Have you tried specifying the path without the drive letter?
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: some general window builder questions - part 2

Postby TEMP USER » Sat Jan 02, 2010 1:09 am

i've tried "../eclipse/" , since i can also use "../workspace" as the workspace.
however, i have a similar problem when adding external jar (SWT.jar) to the project, since the drive letter changes there as well, so i have to manually change it each time i move to another computer.
what do you suggest?
TEMP USER
 
Posts: 60
Joined: Mon Jun 01, 2009 2:46 am

Re: some general window builder questions - part 2

Postby Eric Clayberg » Sat Jan 02, 2010 8:13 am

TEMP USER wrote:i have a similar problem when adding external jar (SWT.jar) to the project, since the drive letter changes there as well, so i have to manually change it each time i move to another computer.
what do you suggest?

Have you tried relative addresses for those as well? What do the folks in the Eclipse SWT newsgroup suggest?
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: some general window builder questions - part 2

Postby TEMP USER » Sat Jan 09, 2010 3:50 am

how do i do that?
also, i haven't asked them that.
TEMP USER
 
Posts: 60
Joined: Mon Jun 01, 2009 2:46 am

Re: some general window builder questions - part 2

Postby Eric Clayberg » Sat Jan 09, 2010 6:54 am

TEMP USER wrote:how do i do that?

Use relative addresses? I assumed you already knew how to do that based on your prior messages.

Just remove the drive letter and ":". For example, rather than...

    "C:/eclipse/plugins/org.eclipse.swt.win32.win32.x86_3.5.1.v3555a.jar"
...use this...

    "/eclipse/plugins/org.eclipse.swt.win32.win32.x86_3.5.1.v3555a.jar"
I tried that and it works fine.

TEMP USER wrote:i haven't asked them that.

General questions about using Eclipse or SWT should be addressed to the appropriate Eclipse newsgroups.

I would recommend "eclipse.platform.swt" or "eclispse.newcomer" for basic questions like this.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: some general window builder questions - part 2

Postby TEMP USER » Mon Jan 11, 2010 3:27 pm

seems that i've found the solution, at least for home. will check it soon on other places. what you wrote worked for WindowBuilder. about SWT, i think the solution was that instead of using "add external jars" , i used "add jars" .

i have a new question:is there a place for windowBuilder that i can see what's new for each new build ? it could be very good to know of cool new stuff that i might want to use... maybe you have rss or something?
TEMP USER
 
Posts: 60
Joined: Mon Jun 01, 2009 2:46 am

Next

Return to SWT Designer

Who is online

Users browsing this forum: Google [Bot] and 2 guests