use of com.extjs.gxt.ui.client.widget.Viewport in project kapua by eclipse.
the class KapuaCloudConsole method renderLoginDialog.
private void renderLoginDialog() {
final Viewport viewport = new Viewport();
final BorderLayout borderLayout = new BorderLayout();
viewport.setLayout(borderLayout);
if (!UserAgentUtils.isIE() || UserAgentUtils.getIEDocumentMode() > 8) {
viewport.setStyleName("login");
} else {
viewport.setStyleName("login-ie8");
}
//
// center
BorderLayoutData centerData = new BorderLayoutData(LayoutRegion.CENTER);
centerData.setMargins(new Margins(0));
centerData.setCollapsible(false);
centerData.setFloatable(false);
centerData.setHideCollapseTool(false);
centerData.setSplit(false);
LayoutContainer splash = new LayoutContainer(new FillLayout());
viewport.add(splash, centerData);
//
// north
SimplePanel ethLogo = new SimplePanel();
if (!UserAgentUtils.isIE() || UserAgentUtils.getIEDocumentMode() > 8) {
ethLogo.setStyleName("ethLogo");
} else {
ethLogo.setStyleName("ethLogo-ie8");
}
SimplePanel cloudLogo = new SimplePanel();
if (!UserAgentUtils.isIE() || UserAgentUtils.getIEDocumentMode() > 8) {
cloudLogo.setStyleName("cloudLogo");
} else {
cloudLogo.setStyleName("cloudLogo-ie8");
}
TableLayout layout = new TableLayout(2);
layout.setWidth("100%");
LayoutContainer lcFooter = new LayoutContainer(layout);
if (!UserAgentUtils.isIE() || UserAgentUtils.getIEDocumentMode() > 8) {
lcFooter.setStyleName("loginBanner");
} else {
lcFooter.setStyleName("loginBanner-ie8");
}
lcFooter.add(cloudLogo, new TableData(Style.HorizontalAlignment.LEFT, Style.VerticalAlignment.BOTTOM));
lcFooter.add(ethLogo, new TableData(Style.HorizontalAlignment.RIGHT, Style.VerticalAlignment.BOTTOM));
BorderLayoutData northData = new BorderLayoutData(LayoutRegion.NORTH, 72);
northData.setCollapsible(false);
northData.setFloatable(false);
northData.setHideCollapseTool(false);
northData.setSplit(false);
northData.setMargins(new Margins(0));
viewport.add(lcFooter, northData);
RootPanel.get().add(viewport);
// Dialog window
final LoginDialog loginDialog = new LoginDialog();
loginDialog.addListener(Events.Hide, new Listener<ComponentEvent>() {
public void handleEvent(ComponentEvent be) {
if (loginDialog.isAllowMainScreen()) {
currentSession = loginDialog.getCurrentSession();
if (currentSession != null) {
String username = currentSession.getGwtUser().getUsername();
if (username != null) {
//
// Enter into the normal viewport
RootPanel.get().remove(viewport);
render(currentSession);
} else {
ConsoleInfo.display(MSGS.error(), MSGS.loginError());
loginDialog.show();
}
} else {
ConsoleInfo.display(MSGS.error(), MSGS.loginError());
loginDialog.show();
}
}
}
});
if (!UserAgentUtils.isIE()) {
Window.addResizeHandler(new ResizeHandler() {
public void onResize(ResizeEvent arg0) {
loginDialog.center();
}
});
}
loginDialog.show();
}
use of com.extjs.gxt.ui.client.widget.Viewport in project activityinfo by bedatadriven.
the class EmbedEntryPoint method addToRootPanel.
private void addToRootPanel(Widget panel) {
Viewport viewport = new Viewport();
viewport.setLayout(new FitLayout());
viewport.add(panel);
RootPanel.get().add(viewport);
}
use of com.extjs.gxt.ui.client.widget.Viewport in project geo-platform by geosdi.
the class GeoPlatformLayoutManager method initLayoutManager.
/**
* Build The Main GeoPlatform UI
*/
private void initLayoutManager() {
viewport = new Viewport();
viewport.setLayout(new BorderLayout());
createEast();
createWest();
createCenter();
createSouth();
}
use of com.extjs.gxt.ui.client.widget.Viewport in project kura by eclipse.
the class denali method render.
private void render(GwtSession gwtSession) {
Log.debug("Beginning page render");
final Viewport viewport = new Viewport();
final BorderLayout borderLayout = new BorderLayout();
viewport.setLayout(borderLayout);
viewport.setStyleAttribute("padding", "5px");
//
// north
BorderLayoutData northData = new BorderLayoutData(LayoutRegion.NORTH, 52);
northData.setCollapsible(false);
northData.setFloatable(false);
northData.setHideCollapseTool(false);
northData.setSplit(false);
northData.setMargins(new Margins(0, 0, 5, 0));
viewport.add(new NorthView(gwtSession), northData);
//
// center
BorderLayoutData centerData = new BorderLayoutData(LayoutRegion.CENTER);
centerData.setMargins(new Margins(0));
ContentPanel center = new ContentPanel();
center.setLayout(new FitLayout());
center.setBorders(false);
center.setBodyBorder(false);
center.setId("center-panel-wrapper");
viewport.add(center, centerData);
//
// west
BorderLayoutData westData = new BorderLayoutData(LayoutRegion.WEST, 180);
westData.setSplit(true);
westData.setCollapsible(true);
westData.setMargins(new Margins(0, 5, 0, 0));
WestNavigationView westView = new WestNavigationView(gwtSession, center, m_connected);
viewport.add(westView, westData);
//
// south
BorderLayoutData southData = new BorderLayoutData(LayoutRegion.SOUTH, 18);
southData.setCollapsible(false);
southData.setFloatable(false);
southData.setHideCollapseTool(false);
southData.setSplit(false);
southData.setMargins(new Margins(3, 5, 0, 0));
final HorizontalPanel south = new HorizontalPanel();
south.setTableWidth("100%");
south.setId("south-panel-wrapper");
Date now = new Date();
@SuppressWarnings("deprecation") int year = now.getYear() + 1900;
Label copyright = new Label(MSGS.copyright(String.valueOf(year)));
copyright.setStyleName("x-form-label");
TableData td = new TableData();
td.setHorizontalAlign(HorizontalAlignment.LEFT);
south.add(copyright, td);
final Label developmentMode = new Label(MSGS.developmentMode());
developmentMode.setStyleName("x-form-label");
developmentMode.getElement().getStyle().setColor("red");
final TableData tdExecMode = new TableData();
tdExecMode.setHorizontalAlign(HorizontalAlignment.LEFT);
if (isDevelopMode) {
south.add(developmentMode, tdExecMode);
}
Label version = new Label(gwtSession.getKuraVersion());
version.setStyleName("x-form-label");
TableData tdVersion = new TableData();
tdVersion.setHorizontalAlign(HorizontalAlignment.RIGHT);
south.add(version, tdVersion);
viewport.add(south, southData);
//
// Initial Selection
// center.setIconAbstractImagePrototype.create(Resources.INSTANCE.alerts()));
// center.setHeading(MSGS.announcements());
// center.removeAll();
// center.add(new Overview(currentSession));
// center.layout();
//
// RootPanel
RootPanel.get().add(viewport);
}
use of com.extjs.gxt.ui.client.widget.Viewport in project kapua by eclipse.
the class KapuaCloudConsole method render.
private void render(GwtSession gwtSession) {
final BorderLayout borderLayout = new BorderLayout();
viewport = new Viewport();
viewport.setLayout(borderLayout);
// Set class name based on account. This allows for styling based on account
// RootPanel.getBodyElement().addClassName(gwtSession.getSelectedAccount().getName());
//
// North View
BorderLayoutData northData = new BorderLayoutData(LayoutRegion.NORTH, 36);
northData.setCollapsible(false);
northData.setFloatable(false);
northData.setHideCollapseTool(false);
northData.setSplit(false);
northData.setMargins(new Margins(0, 0, 5, 0));
northView = new NorthView(currentSession, this);
viewport.add(northView, northData);
//
// Center View
BorderLayoutData centerData = new BorderLayoutData(LayoutRegion.CENTER);
centerData.setMargins(new Margins(0, 5, 0, 0));
centerView = new LayoutContainer();
centerView.setLayout(new FitLayout());
centerView.setBorders(false);
viewport.add(centerView, centerData);
//
// West View
BorderLayoutData westData = new BorderLayoutData(LayoutRegion.WEST, 200);
westData.setSplit(false);
westData.setMargins(new Margins(0, 5, 0, 5));
westView = new WestNavigationView(currentSession, centerView);
viewport.add(westView, westData);
//
// South view
BorderLayoutData southData = new BorderLayoutData(LayoutRegion.SOUTH, 18);
southData.setCollapsible(false);
southData.setFloatable(false);
southData.setHideCollapseTool(false);
southData.setSplit(false);
southData.setMargins(new Margins(5, 5, 5, 5));
southView = new HorizontalPanel();
southView.setTableWidth("100%");
TableData td = new TableData();
td.setHorizontalAlign(HorizontalAlignment.LEFT);
TableData tdVersion = new TableData();
tdVersion.setHorizontalAlign(HorizontalAlignment.RIGHT);
Date now = new Date();
@SuppressWarnings("deprecation") int year = now.getYear() + 1900;
Label copyright = new Label(MSGS.copyright(String.valueOf(year)));
copyright.setStyleName("x-form-label");
Label version = new Label(currentSession.getVersion() + "-" + currentSession.getBuildNumber());
version.setStyleName("x-form-label");
version.setToolTip(currentSession.getBuildVersion());
southView.add(copyright, td);
southView.add(version, tdVersion);
viewport.add(southView, southData);
//
// RootPanel
RootPanel.get().add(viewport);
}
Aggregations