use of com.google.gwt.user.client.ui.Panel in project pentaho-platform by pentaho.
the class MantleXul method customizeAdminStyle.
public void customizeAdminStyle() {
Timer t = new Timer() {
public void run() {
if (container != null) {
cancel();
// call this method when Elements are added to DOM
GwtTree adminCatTree = (GwtTree) container.getDocumentRoot().getElementById("adminCatTree");
adminCatTree.getTree().removeStyleName("gwt-Tree");
Panel adminContentPanel = (Panel) container.getDocumentRoot().getElementById("adminContentPanel").getManagedObject();
adminContentPanel.setWidth("100%");
for (int i = 0; i < adminCatTree.getTree().getItemCount(); i++) {
TreeItem treeItem = adminCatTree.getTree().getItem(i);
Element e = treeItem.getElement();
e.getStyle().clearPadding();
e.addClassName("adminCatTreeItem");
if (i == adminCatTree.getTree().getItemCount() - 1) {
e.addClassName("adminCatTreeItemLast");
}
}
MantleXul.this.selectAdminCatTreeTreeItem(Messages.getString("manageUsersAndRoles").replaceAll("&", "&"));
}
}
};
t.scheduleRepeating(250);
}
use of com.google.gwt.user.client.ui.Panel in project data-access by pentaho.
the class MetadataImportDialogController method promptImportMetadata.
/**
* Shows a promt dialog
*
* @param title
* @param message
* @param radioDSWLabel
* @param radioMetaLabel
* @param onResulthandler
*/
private void promptImportMetadata(final String title, final String message, final String radioDSWLabel, final String radioMetaLabel, final AsyncCallback<Boolean> onResulthandler) {
final VerticalPanel panel = new VerticalPanel();
// $NON-NLS-1$
panel.add(new Label(message));
VerticalPanel vp = new VerticalPanel();
HorizontalPanel hp = new HorizontalPanel();
hp.getElement().getStyle().setMarginBottom(10, Style.Unit.PX);
hp.getElement().getStyle().setMarginTop(10, Style.Unit.PX);
final RadioButton dswRadio = new RadioButton("importMetadata");
RadioButton metadataRadio = new RadioButton("importMetadata");
dswRadio.setEnabled(true);
dswRadio.setValue(true);
hp.add(dswRadio);
hp.add(new Label(radioDSWLabel));
vp.add(hp);
HorizontalPanel hp2 = new HorizontalPanel();
hp2.add(metadataRadio);
hp2.add(new Label(radioMetaLabel));
vp.add(hp2);
panel.add(vp);
XulPromptBox promptBox = new GwtPromptBox() {
@Override
public Panel getDialogContents() {
return panel;
}
@Override
public int open() {
super.show();
dswRadio.setFocus(true);
return 0;
}
@Override
public Panel getButtonPanel() {
Panel button = super.getButtonPanel();
return button;
}
};
promptBox.setTitle(title);
promptBox.setAcceptLabel(resBundle.getString("importDialog.DIALOG_OK", "OK"));
promptBox.setCancelLabel(resBundle.getString("importDialog.DIALOG_Cancel", "Cancel"));
promptBox.addDialogCallback(new XulDialogCallback<String>() {
@Override
public void onClose(XulComponent component, Status status, String value) {
if (status == Status.CANCEL) {
onImportCancel();
reShowDialog();
return;
}
if (onResulthandler != null) {
onResulthandler.onSuccess(dswRadio.getValue());
}
}
@Override
public void onError(XulComponent xulComponent, Throwable throwable) {
onResulthandler.onFailure(throwable);
}
});
promptBox.setWidth(460);
promptBox.setHeight(140);
promptBox.open();
}
use of com.google.gwt.user.client.ui.Panel in project ovirt-engine by oVirt.
the class NetworkPanel method getContents.
@Override
protected Widget getContents() {
Image mgmtNetworkImage;
Image defaultRouteImage;
Image vmImage;
Image monitorImage;
Image migrationImage;
Image notSyncImage;
Image alertImage;
Image glusterNwImage;
if (!item.isManaged()) {
monitorImage = null;
mgmtNetworkImage = null;
defaultRouteImage = null;
vmImage = null;
migrationImage = null;
glusterNwImage = null;
notSyncImage = null;
alertImage = null;
} else {
NetworkCluster networkCluster = item.getNetwork().getCluster();
monitorImage = networkCluster.isDisplay() ? new Image(resources.networkMonitor()) : null;
mgmtNetworkImage = item.isManagement() ? new Image(resources.mgmtNetwork()) : null;
defaultRouteImage = networkCluster.isDefaultRoute() ? new Image(resources.defaultRouteNetwork()) : null;
vmImage = item.getNetwork().isVmNetwork() ? new Image(resources.networkVm()) : null;
migrationImage = networkCluster.isMigration() ? new Image(resources.migrationNetwork()) : null;
glusterNwImage = networkCluster.isGluster() ? new Image(resources.glusterNetwork()) : null;
notSyncImage = !item.isInSync() ? new Image(resources.networkNotSyncImage()) : null;
alertImage = item.getErrorMessage() != null ? new Image(resources.alertImage()) : null;
if (item.isManagement()) {
mgmtNetworkImage.setStylePrimaryName(style.networkImageBorder());
}
if (item.getNetwork().isVmNetwork()) {
vmImage.setStylePrimaryName(style.networkImageBorder());
}
if (networkCluster.isDisplay()) {
monitorImage.setStylePrimaryName(style.networkImageBorder());
}
if (networkCluster.isMigration()) {
migrationImage.setStylePrimaryName(style.networkImageBorder());
}
if (networkCluster.isDefaultRoute()) {
defaultRouteImage.setStylePrimaryName(style.networkImageBorder());
}
if (networkCluster.isGluster()) {
glusterNwImage.setStylePrimaryName(style.networkImageBorder());
}
if (!item.isInSync()) {
notSyncImage.setStylePrimaryName(style.syncImageBorder());
}
}
actionButton.setVisible(item.getAttachedToNic() != null && (item.isManaged() || !item.isAttachedViaLabel()));
Grid rowPanel = new Grid(item.hasVlan() ? 2 : 1, 10);
rowPanel.setCellSpacing(0);
// $NON-NLS-1$
rowPanel.setWidth("100%");
// $NON-NLS-1$
rowPanel.setHeight("100%");
ColumnFormatter columnFormatter = rowPanel.getColumnFormatter();
// $NON-NLS-1$
columnFormatter.setWidth(0, "5px");
// $NON-NLS-1$
columnFormatter.setWidth(1, "20px");
// $NON-NLS-1$
columnFormatter.setWidth(2, "100%");
rowPanel.setWidget(0, 0, dragImage);
Panel statusPanel = new HorizontalPanel();
statusPanel.setStylePrimaryName(style.networkStatusPanel());
rowPanel.setWidget(0, 1, statusPanel);
if (alertImage != null) {
statusPanel.add(alertImage);
}
ImageResource statusImage = getStatusImage();
if (statusImage != null) {
statusPanel.add(new Image(statusImage));
}
if (notSyncImage != null) {
statusPanel.add(notSyncImage);
}
rowPanel.setWidget(0, 2, createTitlePanel());
rowPanel.setWidget(0, 3, mgmtNetworkImage);
rowPanel.setWidget(0, 4, monitorImage);
rowPanel.setWidget(0, 5, vmImage);
rowPanel.setWidget(0, 6, migrationImage);
rowPanel.setWidget(0, 7, glusterNwImage);
rowPanel.setWidget(0, 8, defaultRouteImage);
rowPanel.setWidget(0, 9, actionButton);
if (item.hasVlan()) {
rowPanel.setWidget(1, 2, createVlanPanel());
for (int i = 3; i < rowPanel.getColumnCount(); i++) {
// we need to clear the unused widgets, otherwise there will be few pixels wide empty space
rowPanel.setWidget(1, i, null);
}
}
return rowPanel;
}
use of com.google.gwt.user.client.ui.Panel in project ovirt-engine by oVirt.
the class NetworkPanel method createVlanPanel.
private Panel createVlanPanel() {
Panel vlanPanel = new HorizontalPanel();
Label vlanLabel = new Label(messages.vlanNetwork(item.getVlanId()));
vlanLabel.getElement().addClassName(style.vlanLabel());
vlanPanel.getElement().addClassName(style.fixedTable());
vlanPanel.add(vlanLabel);
return vlanPanel;
}
use of com.google.gwt.user.client.ui.Panel in project libgdx by libgdx.
the class GwtApplication method getPreloaderCallback.
public PreloaderCallback getPreloaderCallback() {
final Panel preloaderPanel = new VerticalPanel();
preloaderPanel.setStyleName("gdx-preloader");
final Image logo = new Image(GWT.getModuleBaseURL() + "logo.png");
logo.setStyleName("logo");
preloaderPanel.add(logo);
final Panel meterPanel = new SimplePanel();
meterPanel.setStyleName("gdx-meter");
meterPanel.addStyleName("red");
final InlineHTML meter = new InlineHTML();
final Style meterStyle = meter.getElement().getStyle();
meterStyle.setWidth(0, Unit.PCT);
meterPanel.add(meter);
preloaderPanel.add(meterPanel);
getRootPanel().add(preloaderPanel);
return new PreloaderCallback() {
@Override
public void error(String file) {
System.out.println("error: " + file);
}
@Override
public void update(PreloaderState state) {
meterStyle.setWidth(100f * state.getProgress(), Unit.PCT);
}
};
}
Aggregations