use of com.extjs.gxt.ui.client.widget.layout.FillLayout 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.layout.FillLayout in project kura by eclipse.
the class WirelessConfigTab method createWifiNetworksWindow.
private Window createWifiNetworksWindow() {
final Window window = new Window();
window.setSize(700, 400);
window.setPlain(true);
window.setModal(true);
window.setBlinkModal(true);
window.setHeading("Wireless Networks");
// Create a table to layout the content
VerticalPanel dialogContents = new VerticalPanel();
dialogContents.setSpacing(4);
window.add(dialogContents);
List<ColumnConfig> configs = new ArrayList<ColumnConfig>();
ColumnConfig column = null;
column = new ColumnConfig("ssid", "SSID", 100);
column.setAlignment(HorizontalAlignment.LEFT);
configs.add(column);
column = new ColumnConfig("macAddress", "MAC Address", 100);
column.setAlignment(HorizontalAlignment.CENTER);
configs.add(column);
column = new ColumnConfig("signalStrength", "Signal (dBm)", 100);
column.setAlignment(HorizontalAlignment.CENTER);
configs.add(column);
column = new ColumnConfig("channel", "Channel", 100);
column.setAlignment(HorizontalAlignment.CENTER);
configs.add(column);
column = new ColumnConfig("frequency", "Frequency", 100);
column.setAlignment(HorizontalAlignment.CENTER);
configs.add(column);
column = new ColumnConfig("security", "Security", 100);
column.setAlignment(HorizontalAlignment.LEFT);
configs.add(column);
/*
CheckColumnConfig checkColumn = new CheckColumnConfig("selectAP", "Select", 55);
CellEditor checkBoxEditor = new CellEditor(new CheckBox());
checkColumn.setEditor(checkBoxEditor);
configs.add(checkColumn);
*/
// rpc data proxy
RpcProxy<ListLoadResult<GwtWifiHotspotEntry>> proxy = new RpcProxy<ListLoadResult<GwtWifiHotspotEntry>>() {
@Override
protected void load(Object loadConfig, final AsyncCallback<ListLoadResult<GwtWifiHotspotEntry>> callback) {
gwtXSRFService.generateSecurityToken(new AsyncCallback<GwtXSRFToken>() {
@Override
public void onFailure(Throwable ex) {
FailureHandler.handle(ex);
}
@Override
public void onSuccess(GwtXSRFToken token) {
gwtNetworkService.findWifiHotspots(token, m_selectNetIfConfig.getName(), callback);
}
});
}
};
m_wifiHotspotLoader = new BaseListLoader<ListLoadResult<GwtWifiHotspotEntry>>(proxy);
m_wifiHotspotLoader.setSortDir(SortDir.ASC);
m_wifiHotspotLoader.setSortField("signalStrength");
// m_wifiHotspotLoader.setRemoteSort(true);
SwappableListStore<GwtWifiHotspotEntry> store = new SwappableListStore<GwtWifiHotspotEntry>(m_wifiHotspotLoader);
store.setKeyProvider(new ModelKeyProvider<GwtWifiHotspotEntry>() {
public String getKey(GwtWifiHotspotEntry wifiHotspotEntry) {
return wifiHotspotEntry.getSignalStrength().toString();
}
});
m_grid = new Grid<GwtWifiHotspotEntry>(store, new ColumnModel(configs));
m_grid.setBorders(false);
m_grid.setStateful(false);
m_grid.setLoadMask(true);
m_grid.setStripeRows(true);
m_grid.setColumnLines(true);
m_grid.setColumnReordering(true);
m_grid.setAutoExpandColumn("ssid");
m_grid.getView().setAutoFill(true);
// m_grid.addPlugin(checkColumn);
m_wifiHotspotLoader.addLoadListener(new DataLoadListener(m_grid));
GridSelectionModel<GwtWifiHotspotEntry> selectionModel = new GridSelectionModel<GwtWifiHotspotEntry>();
selectionModel.setSelectionMode(SelectionMode.SINGLE);
m_grid.setSelectionModel(selectionModel);
// m_grid.addPlugin(selectionModel);
m_grid.getSelectionModel().addSelectionChangedListener(new SelectionChangedListener<GwtWifiHotspotEntry>() {
@Override
public void selectionChanged(SelectionChangedEvent<GwtWifiHotspotEntry> se) {
if (se != null) {
List<GwtWifiHotspotEntry> list = se.getSelection();
if ((list != null) && (list.size() > 0)) {
GwtWifiHotspotEntry wifiHotspotEntry = list.get(0);
if (wifiHotspotEntry != null) {
m_ssidField.setValue(GwtSafeHtmlUtils.htmlUnescape(wifiHotspotEntry.getSSID()));
String security = wifiHotspotEntry.getSecurity();
if (security.equals("None")) {
m_securityCombo.setSimpleValue(MessageUtils.get(GwtWifiSecurity.netWifiSecurityNONE.name()));
} else if (security.equals("WEP")) {
m_securityCombo.setSimpleValue(MessageUtils.get(GwtWifiSecurity.netWifiSecurityWEP.name()));
} else if (security.equals("WPA")) {
m_securityCombo.setSimpleValue(MessageUtils.get(GwtWifiSecurity.netWifiSecurityWPA.name()));
} else if (security.equals("WPA2") || security.equals("WPA/WPA2")) {
m_securityCombo.setSimpleValue(MessageUtils.get(GwtWifiSecurity.netWifiSecurityWPA2.name()));
} else {
m_securityCombo.setSimpleValue(MessageUtils.get(GwtWifiSecurity.netWifiSecurityNONE.name()));
}
if (security.equals("WPA") || security.equals("WPA2") || security.equals("WPA/WPA2")) {
GwtWifiCiphers pairwiseCiphers = wifiHotspotEntry.getPairwiseCiphersEnum();
if (pairwiseCiphers == GwtWifiCiphers.netWifiCiphers_TKIP) {
m_pairwiseCiphersCombo.setSimpleValue(MessageUtils.get(GwtWifiCiphers.netWifiCiphers_TKIP.name()));
} else if (pairwiseCiphers == GwtWifiCiphers.netWifiCiphers_CCMP) {
m_pairwiseCiphersCombo.setSimpleValue(MessageUtils.get(GwtWifiCiphers.netWifiCiphers_CCMP.name()));
} else if (pairwiseCiphers == GwtWifiCiphers.netWifiCiphers_CCMP_TKIP) {
m_pairwiseCiphersCombo.setSimpleValue(MessageUtils.get(GwtWifiCiphers.netWifiCiphers_CCMP_TKIP.name()));
} else {
// let's set it for CCMP TKIP
m_pairwiseCiphersCombo.setSimpleValue(MessageUtils.get(GwtWifiCiphers.netWifiCiphers_CCMP_TKIP.name()));
}
GwtWifiCiphers groupCiphers = wifiHotspotEntry.getGroupCiphersEnum();
if (groupCiphers == GwtWifiCiphers.netWifiCiphers_TKIP) {
m_groupCiphersCombo.setSimpleValue(MessageUtils.get(GwtWifiCiphers.netWifiCiphers_TKIP.name()));
} else if (groupCiphers == GwtWifiCiphers.netWifiCiphers_CCMP) {
m_groupCiphersCombo.setSimpleValue(MessageUtils.get(GwtWifiCiphers.netWifiCiphers_CCMP.name()));
} else if (groupCiphers == GwtWifiCiphers.netWifiCiphers_CCMP_TKIP) {
m_groupCiphersCombo.setSimpleValue(MessageUtils.get(GwtWifiCiphers.netWifiCiphers_CCMP_TKIP.name()));
} else {
// let's set it for CCMP TKIP
m_groupCiphersCombo.setSimpleValue(MessageUtils.get(GwtWifiCiphers.netWifiCiphers_CCMP_TKIP.name()));
}
}
// deselect all channels
for (int channel = 1; channel <= MAX_WIFI_CHANNEL; channel++) {
m_checkboxChannelSelectionModel.deselect(channel - 1);
}
// select proper channels
m_checkboxChannelSelectionModel.select(wifiHotspotEntry.getChannel() - 1, true);
window.hide();
}
}
}
}
});
ContentPanel cp = new ContentPanel();
cp.setHeading("Wireless Networks in Range");
cp.setFrame(true);
cp.setSize(680, 365);
FillLayout layout = new FillLayout();
layout.setAdjustForScroll(true);
cp.setLayout(layout);
cp.add(m_grid);
dialogContents.add(cp);
window.add(dialogContents);
return window;
}
use of com.extjs.gxt.ui.client.widget.layout.FillLayout in project jahia by Jahia.
the class LayoutTabItem method attachPropertiesEditor.
@Override
public void attachPropertiesEditor(final NodeHolder engine, final AsyncTabItem tab) {
if (engine.getNode() != null && engine.getLinker() instanceof EditLinker) {
final PropertiesEditor.PropertyAdapterField templateField = propertiesEditor.getFieldsMap().get("j:view");
final PropertiesEditor.PropertyAdapterField skinField = propertiesEditor.getFieldsMap().get("j:skin");
final PropertiesEditor.PropertyAdapterField subNodesViewField = propertiesEditor.getFieldsMap().get("j:subNodesView");
listener = new SelectionChangedListener<GWTJahiaValueDisplayBean>() {
public void selectionChanged(SelectionChangedEvent<GWTJahiaValueDisplayBean> se) {
Map<String, List<String>> contextParams = new HashMap<String, List<String>>();
if (skinField != null && skinField.getValue() != null) {
contextParams.put("forcedSkin", Arrays.asList(((ComboBox<GWTJahiaValueDisplayBean>) skinField.getField()).getValue().getValue()));
}
if (subNodesViewField != null && subNodesViewField.getValue() != null) {
contextParams.put("forcedSubNodesTemplate", Arrays.asList(((ComboBox<GWTJahiaValueDisplayBean>) subNodesViewField.getField()).getValue().getValue()));
}
String template = (templateField != null && templateField.getValue() != null) ? ((ComboBox<GWTJahiaValueDisplayBean>) templateField.getField()).getValue().getValue() : null;
if (engine.getNode() != null) {
JahiaContentManagementService.App.getInstance().getRenderedContent(engine.getNode().getPath(), null, LayoutTabItem.this.language, template, "preview", contextParams, false, null, null, null, new BaseAsyncCallback<GWTRenderResult>() {
public void onSuccess(GWTRenderResult result) {
HTML html = new HTML(result.getResult());
setHTML(html);
tab.layout();
}
});
} else {
setHTML(null);
}
}
};
if (templateField != null) {
((ComboBox<GWTJahiaValueDisplayBean>) templateField.getField()).addSelectionChangedListener(listener);
}
if (skinField != null) {
((ComboBox<GWTJahiaValueDisplayBean>) skinField.getField()).addSelectionChangedListener(listener);
}
if (subNodesViewField != null) {
((ComboBox<GWTJahiaValueDisplayBean>) subNodesViewField.getField()).addSelectionChangedListener(listener);
}
tab.setLayout(new FillLayout());
if (ctn == null) {
ctn = new LayoutContainer(new FitLayout());
tab.add(ctn);
htmlPreview = new LayoutContainer();
htmlPreview.addStyleName(cssWrapper);
htmlPreview.setStyleAttribute("background-color", "white");
FieldSet f = new FieldSet();
f.addStyleName("x-panel");
f.setHeadingHtml(Messages.get("label.preview", "Preview"));
f.setScrollMode(Style.Scroll.AUTO);
f.add(htmlPreview);
tab.add(f);
}
ctn.add(propertiesEditor);
} else {
super.attachPropertiesEditor(engine, tab);
}
}
use of com.extjs.gxt.ui.client.widget.layout.FillLayout in project jahia by Jahia.
the class AbstractContentEngine method init.
protected void init(EngineContainer container) {
this.container = container;
setLayout(new FillLayout());
addStyleName("content-engine");
buttonBar = new ButtonBar();
buttonBar.addStyleName("JahiaEditEngineButtonBar");
container.setEngine(this, heading, buttonBar, null, this.getLinker());
// init language switcher
initLanguageSwitcher();
// init tabs
tabs = new TabPanel();
tabs.setBodyBorder(false);
tabs.setBorders(true);
add(tabs);
buttonBar.setAlignment(Style.HorizontalAlignment.CENTER);
initFooter();
container.getPanel().setFooter(true);
loading();
}
use of com.extjs.gxt.ui.client.widget.layout.FillLayout in project jahia by Jahia.
the class DeployPortletDefinitionActionItem method onComponentSelection.
public void onComponentSelection() {
GWT.runAsync(new RunAsyncCallback() {
@Override
public void onFailure(Throwable reason) {
}
@Override
public void onSuccess() {
LinkerSelectionContext lh = linker.getSelectionContext();
GWTJahiaNode parent = lh.getSingleSelection();
if (parent != null) {
final com.extjs.gxt.ui.client.widget.Window w = new com.extjs.gxt.ui.client.widget.Window();
w.addStyleName("deploy-portlet-definition-modal");
w.setHeadingHtml(Messages.get("label.deployNewPortlet", "New portlets"));
w.setModal(true);
w.setResizable(false);
w.setBodyBorder(false);
w.setLayout(new FillLayout());
w.setWidth(600);
w.add(new FormDeployPortletDefinition() {
@Override
public void closeParent() {
w.hide();
}
@Override
public void refreshParent() {
Map<String, Object> data = new HashMap<String, Object>();
data.put(Linker.REFRESH_ALL, true);
linker.refresh(data);
}
});
w.setScrollMode(Style.Scroll.AUTO);
w.layout();
w.show();
}
}
});
}
Aggregations