Moveable Panels in GWT? - gwt

I need some panels in GWT that have moveable functionality. This is so that if you have a series of event-driven panels that have to be displayed on screen, they aren't all directly on top of each other. This can cause problems when you want to compare two different panels or want to close panels in your own order.
I'm currently using PopupPanels which as far as I'm aware, don't have this functionality.

I think what you want is a DialogBox. This class is a movable PopupPanel and has a constructor argument to create it as non modal, meaning if set to non modal mouse/keyboard events outside the panel are not ignored, but passed to the underlying widgets. This allows to open multiple DialogBox at once and being able to click on them or what's under it.
However, these panels can be moved inside the whole browser window and it's not possible to limit the movable area in the browser window. If you want such functionality you might want to look at the http://code.google.com/p/gwt-dnd/ library, which makes it possible to create movable panels inside a specific area.

Does your DialogBox refuse to be moved/dragged around? Make sure you DO NOT add() it into your RootPanel. Just create a new dialog and call show() on it.

Related

Draggable window in a EditorWindow extended class

I want to make a complex GUI element consistent of buttons, text fields etc. I'd like to be able to move this group, but I can't find a way how.
I tried making a BeginArea, placing all the elements in it and moving the area. For that used a GUI.RepeatButton to check when the mouse button is pressed. It worked, but the update fires only twice and then stops. So I couldn't use this method for smooth dragging.
I've also tried Window to use it with GUI.DragWindow(), but it seems it doesn't work within classes that extend EditorWindow.
Is there a way to make a draggable group for a custom EditorWindow class?

Panels Vs LayoutPanles in GWT

I'm a newbie to GWT.And i wonder when to use panels and when to use layout panels.I'm really confused.Can anyone provide a legit use case , where we need to use panels instead of layout panels and vice versa?.Thanks.
When you need a child to take its initial size from a parent and then resize when a parent resizes, use a LayoutPanel or another panel that implements ProvidesResize() interface. This way, for example, you can split the browser window into top menu and main area parts, and make the main area change its size as the browser windows is resized.
When you want a panel to take its size from its own content, use HTMLPanel or FlowPanel.

How do I force the eclipse Outline View to request a new ContentOutlinePage?

I have an editor which can supply two different ContentOutlinePages to the outline, depending on the user's choice.
However, when I change the ContentOutlinePage to be displayed, I have to close and reopen the Outline View to see any changes. I understand that the Outline View requests a new ContentOutlinePage when the editor is activated, but is there a way to force it to request a new page at any other time?
I tried just calling
activePage.activate(editor);
where activePage is the active workbench page and editor ist the editor that is currently being displayed, but that didn't work.
Rather than have two content pages you could have one page that can show both of your outlines. To do this you cannot extend the normal ContentOutlinePage, instead you need a class like this:
public class MyContentOutlinePage extends Page
implements IContentOutlinePage, ISelectionChangedListener
The amount of code in the standard ContentOutlinePage is quite small so it is not much extra work to implement a page which meets your needs.
Update:
You would have one top level control containing the SashForm and TreeViewer and always return the top control in getControl(). You would hide either the SashForm or TreeViewer depending on which you want to show.
The top level control could be something like PageBook or a Composite using StackLayout.

GWT ToolTip -Requirement

I am looking for tooltip/widget/popup panel like this one
Any idea for such tooltip in GWT ?? I tried ballon widget in gwt,but that does not help me,i need a tooltip like the one above that should also be selectable!
PopupPanel is certainly your best start. PopupPanel will get you an undecorated square box like your example, with user interaction.
Depending on your design requirements you can setup the content with straight HTML (embed an HTMLPanel, with the HTML as contents, inside a PopupPanel), or lay it out using the GWT layout tool.
Also look over: DecoratedPopupPanel for some ideas about decorating the border of your panel with css rules. This may help with the little triangle pointer at the top.
One more hint: you might end up embedding a FocusPanel in your PopupPanel if you need to track events outside specific GUI elements.

Change content of a Label depending on panel size

once again I've got a question. Since I am using Google Web Toolkit (GWT) at work (along with Java Servlets), I am currently building some user interface with GWT (in Java).
I've got some trouble though. I am using a SplitLayoutPanel which contains a ScrollPanel on the left and another one on the right.
In the left ScrollPanel there's a VerticalPanel with several Labels, which differ in their width. What I want to accomplish, is: if the Label's text doesn't fit in one line, it should display as many characters as possible and have a "..." in the end, if it's not fully displayed.
I am about to add a CustomEvent EventHandler for the Label, which can be fired whenever the Label needs to change its content. Now the problem however is, that I'd need to fire the event whenever the ScrollPanel or its inner VerticalPanel is resized (by dragging the SplitLayoutPanel-Splitter).
Now the question: is it possible to override some sort of "onResize"-Event or at least "onMouseMove"-Event inside the VerticalPanel, so that I could fire the "changeLabelSize()"-method for each Label inside of this VerticalPanel?
How would I go about it? Thank you all for your time in advance! Please ask for anything unclear, so I can clarify it.
Best regards,
Igor.
This can be done easily with the CSS property text-overflow: ellipsis;.
Supported by IE7-, Safari and Konqueror.
And it can be emulated in Firefox.