English 中文(简体)
GWT - 使合成物与右侧相配
原标题:GWT - align composite to right side

In GWT 我需要一个类似于Eclipse View的组合。

  • 观点组合包含其他纵向组合。

  • first row is a View toolbar with multiple PushButton. User clicks them to execute some action. Toolbar has to be aligned to right side of the view composite.

  • composites placed in second and subsequent rows are used to display some values. These are to be aligned to left side of the view composite.

    • View


With following code snippet i am able to align the toolbar to right and place rest of composites on left

CaptionPanel view = new CaptionPanel("Eclipse like view");
VerticalPanel vPanel = new VerticalPanel();
view.setContentWidget(vPanel);

ViewToolbar toolbar = new ViewToolbar();   // custom composite
vPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
vPanel.add(toolbar);        

ViewContent viewContent = new ViewContent(); // custom composite
vPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
vPanel.add(viewContent);

这符合要求。 但我不知道,像这一样,横向协调是否是一个好的想法。

Is there any better way to align some composites to the right side and others to left side of the panel.

问题回答

在我看来,使用像<代码”这样的东西。 HasHorizontal 配对。 签字-LEFT,如果必须改变,则是一种好的方式。

another way to do it could be using CSS declaration and methods like myThing.addStyleName( myCustomStyle )

或使用手法作风





相关问题
Refresh the UI in gwt

I have created some custom composite widget, which listens to an events (in my case loginEvent). Once the event is caught the state of the widget changes so as the way it should look (in my case I ...

How to create a development/debug and production setup

I recently deployed inadvertently a debug version of our game typrX (typing races at www.typrx.com - try it it s fun). It was quickly corrected but I know it may happen again. After digging on ...

GWT error at runtime: ....style_0 is null

My code works fine in IE 8, but on firefox 3.5, the javascript fails to load. I used firebug to figure out why, and the error I get is (GWT detailed mode) My suspicion is that some style is not ...

GWT s hosted mode not working

I ve been stumped for a while trying to figure out why my GWT demo app isn t working in hosted mode so I went back and downloaded the Google Web Toolkit again, unzipped it and simply went to the ...

How to disable Google Visualizations Tool Tips?

Does anyone know how to disable the tool-tip boxes that popup when a Google Visualizations chart is clicked (Selected)? Following the sample code at Getting Started with Visualizations, the "...

GWT 2 CssResource how to

I have a GWT 1.7 application and I want to upgrade it to GWT 2 Milestone 2. The application uses 2 big external CSS files. In GWT 1.7 I had a public folder and put both the CSS files in the folder and ...

热门标签