Java Code Examples for com.google.gwt.user.client.ui.HTML#setStyleName()

The following examples show how to use com.google.gwt.user.client.ui.HTML#setStyleName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CubaTwinColSelectWidget.java    From cuba with Apache License 2.0 6 votes vote down vote up
protected void enableAddAllBtn() {
    HTML br1 = new HTML("<span/>");
    br1.setStyleName(CLASSNAME + "-deco");
    buttons.add(br1);
    buttons.insert(br1, buttons.getWidgetIndex(addItemsLeftToRightButton) + 1);
    addAll = new VButton();
    addAll.setText(">>");
    addAll.addStyleName("addAll");
    addAllHandlerRegistration = addAll.addClickHandler(this);
    buttons.insert(addAll, buttons.getWidgetIndex(br1) + 1);

    HTML br2 = new HTML("<span/>");
    br2.setStyleName(CLASSNAME + "-deco");
    buttons.add(br2);

    removeAll = new VButton();
    removeAll.setText("<<");
    removeAll.addStyleName("removeAll");
    removeAllHandlerRegistration = removeAll.addClickHandler(this);
    buttons.add(removeAll);
}
 
Example 2
Source File: YoungAndroidFormUpgrader.java    From appinventor-extensions with Apache License 2.0 6 votes vote down vote up
private static void upgradeWarnDialog(String aMessage) {
  final DialogBox dialogBox = new DialogBox(false, true);
  dialogBox.setStylePrimaryName("ode-DialogBox");
  dialogBox.setText(MESSAGES.warningDialogTitle());
  dialogBox.setGlassEnabled(true);
  dialogBox.setAnimationEnabled(true);
  final HTML message = new HTML(aMessage);
  message.setStyleName("DialogBox-message");
  VerticalPanel vPanel = new VerticalPanel();
  Button okButton = new Button("OK");
  okButton.addClickListener(new ClickListener() {
      @Override
      public void onClick(Widget sender) {
        dialogBox.hide();
      }
    });
  vPanel.add(message);
  vPanel.add(okButton);
  dialogBox.setWidget(vPanel);
  dialogBox.center();
  dialogBox.show();
}
 
Example 3
Source File: Ode.java    From appinventor-extensions with Apache License 2.0 6 votes vote down vote up
/**
 * This dialog is showned if an account is disabled. It is
 * completely modal with no escape. The provided URL is displayed in
 * an iframe, so it can be tailored to each person whose account is
 * disabled.
 *
 * @param Url the Url to display in the dialog box.
 */

public void disabledAccountDialog(String Url) {
  // Create the UI elements of the DialogBox
  final DialogBox dialogBox = new DialogBox(false, true); // DialogBox(autohide, modal)
  dialogBox.setStylePrimaryName("ode-DialogBox");
  dialogBox.setText(MESSAGES.accountDisabledMessage());
  dialogBox.setHeight("700px");
  dialogBox.setWidth("700px");
  dialogBox.setGlassEnabled(true);
  dialogBox.setAnimationEnabled(true);
  dialogBox.center();
  VerticalPanel DialogBoxContents = new VerticalPanel();
  HTML message = new HTML("<iframe src=\"" + Url + "\" style=\"border: 0; width: 680px; height: 660px;\"></iframe>");
  message.setStyleName("DialogBox-message");
  DialogBoxContents.add(message);
  dialogBox.setWidget(DialogBoxContents);
  dialogBox.show();
}
 
Example 4
Source File: TimeGrid.java    From unitime with Apache License 2.0 6 votes vote down vote up
public BusyPanel(String text, int dayOfWeek, int startSlot, int length) {
	super();
	iText = text;
	iDayOfWeek = dayOfWeek;
	iStartSlot = startSlot;
	iLength = length;
	if (iText != null || !iText.isEmpty()) {
		setTitle(iText);
		boolean empty = true;
		for (int i = 0; i < 3; i++) {
			if (iMeetingTable[iDayOfWeek].length <= iStartSlot + i) { empty = false; break; }
			if (iMeetingTable[iDayOfWeek][iStartSlot + i] != null && !iMeetingTable[iDayOfWeek][iStartSlot + i].isEmpty()) {
				empty = false; break;
			}
		}
		if (empty) {
			HTML widget = new HTML(text, false);
			widget.setStyleName("text");
			setWidget(widget);
		}
	}
	setStyleName("busy");
	getElement().getStyle().setWidth(iCellWidth + (iPrint ? 3 : iDayOfWeek + 1 < iNrDays ? 3 : 0), Unit.PX);
	getElement().getStyle().setHeight(125 * iLength / 30, Unit.PX);
	iGrid.insert(this, iCellWidth * iDayOfWeek, 125 * iStartSlot / 30 - 50 * iStart, 1);
}
 
Example 5
Source File: FinderTooltip.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
private void showTooltip() {
    HTML html = new HTML(context.render(this.currentItem));
    html.setStyleName("finder-tooltip-content");
    this.popup.setWidget(html);

    switch (this.popup.getArrow())
    {
        case BOTTOM:
        {
            int left = currentAnchor.getAbsoluteLeft();
            int top = currentAnchor.getAbsoluteTop();
            int width = currentAnchor.getOffsetWidth();
            this.popup.setPopupPosition(
                    left+20,
                    top-40
            );
            break;
        }
        default: {
            this.popup.setPopupPosition(
                    currentAnchor.getAbsoluteLeft(),
                    currentAnchor.getAbsoluteTop()
            );
        }

    }

    this.popup.setAutoHideEnabled(true);
    this.popup.show();
}
 
Example 6
Source File: RoomGroupsTable.java    From unitime with Apache License 2.0 5 votes vote down vote up
protected Widget getCell(final GroupInterface group, final RoomGroupsColumn column, final int idx) {
	switch (column) {
	case NAME:
		return new Label(group.getLabel() == null ? "" : group.getLabel(), false);
	case ABBREVIATION:
		return new Label(group.getAbbreviation() == null ? "" : group.getAbbreviation(), false);
	case DEFAULT:
		if (group.isDefault())
			return new Image(RESOURCES.on());
		else
			return null;
	case DEPARTMENT:
		return new DepartmentCell(true, group.getDepartment());
	case DESCRIPTION:
		if (group.hasDescription()) {
			HTML html = new HTML(group.getDescription());
			html.setStyleName("description");
			return html;
		} else
			return null;
	case ROOMS:
		if (group.hasRooms())
			return new RoomsCell(group);
		else
			return null;
	default:
		return null;
	}
}
 
Example 7
Source File: TXMetricViewImpl.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Override
public Widget createWidget() {
    HTML refreshBtn = new HTML("<i class='icon-refresh'></i> Refresh Results");
                  refreshBtn.setStyleName("html-link");
                  refreshBtn.getElement().getStyle().setPosition(Style.Position.RELATIVE);
                  refreshBtn.getElement().getStyle().setTop(-80, Style.Unit.PX);
                  refreshBtn.getElement().getStyle().setMarginTop(10, Style.Unit.PX);
                  refreshBtn.getElement().getStyle().setFloat(Style.Float.RIGHT);
                  refreshBtn.getElement().getStyle().setLeft(80, Style.Unit.PCT);

    refreshBtn.ensureDebugId(Console.DEBUG_CONSTANTS.debug_label_refresh_tXMetricViewImp());

    refreshBtn.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            presenter.refresh();
        }
    });

    this.executionMetric = new TXExecutionView();
    this.rollbackMetric = new TXRollbackView();
    this.statisticsInfo = new GeneralView();

    SimpleLayout layout = new SimpleLayout()
            .setTitle("Transaction Manager")
            .setHeadline("Transaction Metrics")
            .setDescription(Console.CONSTANTS.subys_tx_metric_desc())
            .addContent("", refreshBtn)
            .addContent("General Info", statisticsInfo.asWidget())
            .addContent("Executions", executionMetric.asWidget())
            .addContent("Rollbacks", rollbackMetric.asWidget());


    return layout.build();
}
 
Example 8
Source File: PropertiesStep.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Override
protected Widget asWidget(Context<T> context) {
    propertyEditor = new PropertyEditor(this, true, true);

    errorMessages = new HTML(Console.CONSTANTS.subsys_jca_err_prop_required());
    errorMessages.setStyleName("error-panel");
    errorMessages.setVisible(false);

    FlowPanel body = new FlowPanel();
    body.add(errorMessages);
    body.add(propertyEditor.asWidget());
    return body;
}
 
Example 9
Source File: Wizard.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Override
public Widget asWidget() {
    assertSteps();
    state = initialState();

    VerticalPanel root = new VerticalPanel();
    root.setStyleName("window-content");

    header = new HTML();
    errorMessages = new HTML();
    errorMessages.setVisible(false);
    errorMessages.setStyleName("error-panel");
    body = new StateDeckPanel();
    footer = new Footer();

    int index = 0;
    for (Map.Entry<S, WizardStep<C, S>> entry : steps.entrySet()) {
        stateIndex.put(entry.getKey(), index);
        body.add(entry.getValue().asWidget(context));
        index++;
    }

    root.add(header);
    root.add(errorMessages);
    root.add(body);
    pushState(state);

    return new TrappedFocusPanel(new WindowContentBuilder(root, footer.asWidget()).build());
}
 
Example 10
Source File: JndiView.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Override
public Widget createWidget() {

    SimpleLayout layout = new SimpleLayout()
                           .setTitle(Console.CONSTANTS.subsys_naming_jndiView())
                           .setHeadline(Console.CONSTANTS.subsys_naming_jndiBindings());

    HTML refreshButton = new HTML("<i class='icon-refresh'></i> Refresh Results");
    refreshButton.setStyleName("html-link");
    refreshButton.getElement().getStyle().setPosition(Style.Position.RELATIVE);
    refreshButton.getElement().getStyle().setTop(-10, Style.Unit.PX);
    refreshButton.getElement().getStyle().setFloat(Style.Float.RIGHT);
    refreshButton.getElement().getStyle().setLeft(88, Style.Unit.PCT);

    layout.addContent("", refreshButton);

    refreshButton.ensureDebugId(Console.DEBUG_CONSTANTS.debug_label_refresh_jndiView());

    refreshButton.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            presenter.refresh();
        }
    });

    container = new VerticalPanel();
    container.setStyleName("fill-layout");

    layout.addContent("", container);

    return layout.build();
}
 
Example 11
Source File: Ode.java    From appinventor-extensions with Apache License 2.0 5 votes vote down vote up
/**
 * Show a Dialog Box when we receive an SC_PRECONDITION_FAILED
 * response code to any Async RPC call. This is a signal that
 * either our session has expired, or our login cookie has otherwise
 * become invalid. This is a fatal error and the user should not
 * be permitted to continue (many ignore the red error bar and keep
 * working, in vain). So now when this happens, we put up this
 * modal dialog box which cannot be dismissed. Instead it presents
 * just one option, a "Reload" button which reloads the browser.
 * This should trigger a re-authentication (or in the case of an
 * App Inventor upgrade trigging the problem, the loading of newer
 * code).
 */

public void sessionDead() {
  // Create the UI elements of the DialogBox
  final DialogBox dialogBox = new DialogBox(false, true); // DialogBox(autohide, modal)
  dialogBox.setStylePrimaryName("ode-DialogBox");
  dialogBox.setText(MESSAGES.invalidSessionDialogText());
  dialogBox.setWidth("400px");
  dialogBox.setGlassEnabled(true);
  dialogBox.setAnimationEnabled(true);
  dialogBox.center();
  VerticalPanel DialogBoxContents = new VerticalPanel();
  HTML message = new HTML(MESSAGES.sessionDead());
  message.setStyleName("DialogBox-message");
  FlowPanel holder = new FlowPanel();
  Button reloadSession = new Button(MESSAGES.reloadWindow());
  reloadSession.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
        dialogBox.hide();
        reloadWindow(true);
      }
    });
  holder.add(reloadSession);
  DialogBoxContents.add(message);
  DialogBoxContents.add(holder);
  dialogBox.setWidget(DialogBoxContents);
  dialogBox.show();
}
 
Example 12
Source File: Ode.java    From appinventor-extensions with Apache License 2.0 5 votes vote down vote up
/**
 * Possibly display the MIT App Inventor "Splash Screen"
 *
 * @param force Bypass the check to see if they have dimissed this version
 */
private void createWelcomeDialog(boolean force) {
  if (!shouldShowWelcomeDialog() && !force) {
    maybeShowNoProjectsDialog();
    return;
  }
  // Create the UI elements of the DialogBox
  final DialogBox dialogBox = new DialogBox(false, true); // DialogBox(autohide, modal)
  dialogBox.setStylePrimaryName("ode-DialogBox");
  dialogBox.setText(MESSAGES.createWelcomeDialogText());
  dialogBox.setHeight(splashConfig.height + "px");
  dialogBox.setWidth(splashConfig.width + "px");
  dialogBox.setGlassEnabled(true);
  dialogBox.setAnimationEnabled(true);
  dialogBox.center();
  VerticalPanel DialogBoxContents = new VerticalPanel();
  HTML message = new HTML(splashConfig.content);
  message.setStyleName("DialogBox-message");
  FlowPanel holder = new FlowPanel();
  Button ok = new Button(MESSAGES.createWelcomeDialogButton());
  final CheckBox noshow = new CheckBox(MESSAGES.doNotShow());
  ok.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
        dialogBox.hide();
        if (noshow.getValue()) { // User checked the box
          userSettings.getSettings(SettingsConstants.SPLASH_SETTINGS).
            changePropertyValue(SettingsConstants.SPLASH_SETTINGS_VERSION,
              "" + splashConfig.version);
          userSettings.saveSettings(null);
        }
        maybeShowNoProjectsDialog();
      }
    });
  holder.add(ok);
  holder.add(noshow);
  DialogBoxContents.add(message);
  DialogBoxContents.add(holder);
  dialogBox.setWidget(DialogBoxContents);
  dialogBox.show();
}
 
Example 13
Source File: EventMeetingTable.java    From unitime with Apache License 2.0 5 votes vote down vote up
protected void showDetails() {
	if (iDetails != null && iDetails.hasDetails()) {
		HTML details = new HTML(iDetails.getDetails());
		details.setStyleName("unitime-CourseDetailsPopup");
		GwtHint.showHint(getElement(), details);
	}
}
 
Example 14
Source File: VMMetricsView.java    From core with GNU Lesser General Public License v2.1 4 votes vote down vote up
@Override
public Widget createWidget() {

    LayoutPanel layout = new LayoutPanel();

    FakeTabPanel titleBar = new FakeTabPanel("Virtual Machine Status");
    layout.add(titleBar);

    ClickHandler refreshHandler = new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            presenter.refresh();
        }
    };

    // ----

    VerticalPanel vpanel = new VerticalPanel();
    vpanel.setStyleName("rhs-content-panel");

    ScrollPanel scroll = new ScrollPanel(vpanel);
    layout.add(scroll);

    layout.setWidgetTopHeight(titleBar, 0, Style.Unit.PX, 40, Style.Unit.PX);
    layout.setWidgetTopHeight(scroll, 40, Style.Unit.PX, 100, Style.Unit.PCT);

    // ------------------------

    osName = new HTML();
    processors = new HTML();
    uptime = new HTML();

    HorizontalPanel header = new HorizontalPanel();
    header.setStyleName("fill-layout-width");
    vmName = new ContentHeaderLabel("");
    header.add(vmName);

    HTML refreshBtn = new HTML("<i class='icon-refresh'></i> Refresh Results");
    refreshBtn.setStyleName("html-link");
    refreshBtn.addClickHandler(refreshHandler);

    osPanel = new VerticalPanel();
    osPanel.add(refreshBtn);

    header.add(osPanel);

    vpanel.add(header);
    vpanel.add(osName);
    vpanel.add(processors);
    vpanel.add(uptime);

    // 50/50
    osPanel.getElement().getParentElement().setAttribute("style", "width:50%; vertical-align:top;padding-right:15px;");
    osPanel.getElement().getParentElement().setAttribute("align", "right");
    vmName.getElement().getParentElement().setAttribute("style", "width:50%; vertical-align:top");




    // --

    heapChart = new HeapChartView("Heap Usage") ;
    nonHeapChart = new HeapChartView("Non Heap Usage", false) ;

    vpanel.add(heapChart.asWidget());
    Widget widget = nonHeapChart.asWidget();
    //vpanel.add(widget);

    // --

    threadChart = new ThreadChartView("Thread Usage");
    vpanel.add(threadChart.asWidget());
    //threadPanel.add(osPanel);

    return layout;
}
 
Example 15
Source File: LHSProfileNavigation.java    From core with GNU Lesser General Public License v2.1 4 votes vote down vote up
public LHSProfileNavigation() {

        layout = new VerticalPanel();
        layout.setStyleName("fill-layout-width");

        stack = new VerticalPanel();
        stack.setStyleName("fill-layout-width");
        stack.getElement().getStyle().setBackgroundColor("#ffffff");


        profileSelector = new ProfileSelector();
        Widget selectorWidget = profileSelector.asWidget();
        selectorWidget.getElement().getStyle().setPadding(10, Style.Unit.PX);

        HTML title = new HTML("Subsystems");
        title.setStyleName("server-picker-section-header");

        VerticalPanel p = new VerticalPanel();
        p.setStyleName("fill-layout-width");
        p.add(title);
        p.add(selectorWidget);

        stack.add(p);

        subsystemTree = new LHSNavTree("profiles");
        subsystemTree.getElement().setAttribute("style", "padding: 5px;");
        subsystemTree.getElement().setAttribute("aria-label", "Profile Tasks");

        /*subsystemLeaf = new LHSTreeSection(Console.CONSTANTS.common_label_subsystems());
        subsystemTree.addItem(subsystemLeaf);*/

        // --------

        commonTree = new LHSNavTree(Console.CONSTANTS.common_label_generalConfig());

        LHSNavTreeItem interfaces = new LHSNavTreeItem(Console.CONSTANTS.common_label_interfaces(), NameTokens.InterfacePresenter);
        LHSNavTreeItem sockets = new LHSNavTreeItem(Console.CONSTANTS.common_label_socketBinding(), NameTokens.SocketBindingPresenter);
        LHSNavTreeItem paths = new LHSNavTreeItem(Console.CONSTANTS.common_label_paths(), NameTokens.PathManagementPresenter);
        LHSNavTreeItem properties = new LHSNavTreeItem(Console.CONSTANTS.common_label_systemProperties(), NameTokens.PropertiesPresenter);

        commonTree.addItem(interfaces);
        commonTree.addItem(sockets);
        commonTree.addItem(paths);
        commonTree.addItem(properties);

        commonTree.expandTopLevel();

        stack.add(subsystemTree);

        HTML commonTitle = new HTML("General Configuration");
        commonTitle.setStyleName("server-picker-section-header");
        stack.add(commonTitle);
        stack.add(commonTree);

        layout.add(stack);

        scroll = new ScrollPanel(layout);
    }
 
Example 16
Source File: JMSEditor.java    From core with GNU Lesser General Public License v2.1 3 votes vote down vote up
public Widget asWidget() {

        LayoutPanel layout = new LayoutPanel();

        VerticalPanel panel = new VerticalPanel();
        panel.setStyleName("rhs-content-panel");

        ScrollPanel scroll = new ScrollPanel(panel);
        layout.add(scroll);

        layout.setWidgetTopHeight(scroll, 0, Style.Unit.PX, 100, Style.Unit.PCT);

        // ---

        serverName = new HTML("Replace me");
        serverName.setStyleName("content-header-label");

        panel.add(serverName);
        panel.add(new ContentDescription("Queue and Topic destinations."));

        // ----

        TabPanel bottomLayout = new TabPanel();
        bottomLayout.addStyleName("default-tabpanel");
        bottomLayout.addStyleName("master_detail-detail");

        queueList = new QueueList(presenter);
        bottomLayout.add(queueList.asWidget(),"Queues");

        topicList = new TopicList(presenter);
        bottomLayout.add(topicList.asWidget(),"Topics");

        bottomLayout.selectTab(0);

        panel.add(bottomLayout);

        return layout;
    }
 
Example 17
Source File: AcceptorOverview.java    From core with GNU Lesser General Public License v2.1 2 votes vote down vote up
Widget asWidget() {
    LayoutPanel layout = new LayoutPanel();

    VerticalPanel panel = new VerticalPanel();
    panel.setStyleName("rhs-content-panel");

    ScrollPanel scroll = new ScrollPanel(panel);
    layout.add(scroll);

    layout.setWidgetTopHeight(scroll, 0, Style.Unit.PX, 100, Style.Unit.PCT);

    serverName = new HTML(Console.CONSTANTS.replace_me());
    serverName.setStyleName("content-header-label");

    HorizontalPanel header = new HorizontalPanel();
    header.setStyleName("fill-layout-width");
    header.add(serverName);

    final DeckPanel deck = new DeckPanel();
    deck.addStyleName("fill-layout");

    final ListBox selector = new ListBox();

    selector.addItem("Type: Remote");
    selector.addItem("Type: In-VM");
    selector.addItem("Type: Generic");

    selector.addChangeHandler(changeEvent -> deck.showWidget(selector.getSelectedIndex()));

    header.add(selector);
    selector.getElement().getParentElement().setAttribute("align", "right");

    panel.add(header);
    panel.add(new ContentDescription(Console.CONSTANTS.hornetq_acceptor_type_desc()));

    genericAcceptors = new AcceptorList(presenter, AcceptorType.GENERIC);
    remoteAcceptors = new AcceptorList(presenter, AcceptorType.REMOTE);
    invmAcceptors = new AcceptorList(presenter, AcceptorType.INVM);

    deck.add(remoteAcceptors.asWidget());
    deck.add(invmAcceptors.asWidget());
    deck.add(genericAcceptors.asWidget());

    deck.showWidget(0);

    panel.add(deck);

    return layout;
}
 
Example 18
Source File: LHSHostsNavigation.java    From core with GNU Lesser General Public License v2.1 2 votes vote down vote up
public LHSHostsNavigation() {


        layout = new VerticalPanel();
        layout.setStyleName("fill-layout-width");

        stack = new VerticalPanel();
        stack.setStyleName("fill-layout-width");
        stack.getElement().getStyle().setBackgroundColor("#ffffff");

        domainNav = new LHSNavTree("hosts");
        domainNav.getElement().setAttribute("aria-label", "Domain Tasks");
        domainNav.getElement().setAttribute("style", "padding-top:10px; padding-bottom:10px");

        hostNav = new LHSNavTree("hosts");
        hostNav.getElement().setAttribute("aria-label", "Host Tasks");
        hostNav.getElement().setAttribute("style", "padding-top:10px; padding-bottom:10px");

        // --------

        HTML title = new HTML("Domain");
        title.setStyleName("server-picker-section-header");

        domainNav.addItem(new LHSNavTreeItem("Overview", NameTokens.Topology));
        domainNav.addItem(new LHSNavTreeItem("Server Groups", NameTokens.ServerGroupPresenter));

        hostSelector = new HostSelector();


        // --------


        LHSNavTreeItem serversItem = new LHSNavTreeItem(Console.CONSTANTS.common_label_serverConfigs(), NameTokens.ServerPresenter);
        hostNav.addItem(serversItem);

        // --------

        //LHSNavTreeItem paths = new LHSNavTreeItem(Console.CONSTANTS.common_label_paths(), "hosts/host-paths");
        LHSNavTreeItem jvms = new LHSNavTreeItem(Console.CONSTANTS.common_label_virtualMachines(), "host-jvms");
        LHSNavTreeItem interfaces = new LHSNavTreeItem(Console.CONSTANTS.common_label_interfaces(), "host-interfaces");
        LHSNavTreeItem properties = new LHSNavTreeItem("Host Properties", "host-properties");


        hostNav.addItem(jvms);
        hostNav.addItem(interfaces);
        hostNav.addItem(properties);


        // --------
        stack.add(title);
        stack.add(domainNav);

        HTML commonTitle = new HTML("Host Configuration");
        commonTitle.setStyleName("server-picker-section-header");
        stack.add(commonTitle);
        Widget hostSelectorWidget = hostSelector.asWidget();
        hostSelectorWidget.getElement().getStyle().setPadding(10, Style.Unit.PX);

        stack.add(hostSelectorWidget);
        stack.add(hostNav);

        domainNav.expandTopLevel();
        hostNav.expandTopLevel();

        // --------


        layout.add(stack);

        scroll = new ScrollPanel(layout);

    }
 
Example 19
Source File: LHSStandaloneNavigation.java    From core with GNU Lesser General Public License v2.1 2 votes vote down vote up
public LHSStandaloneNavigation() {
    super();

    layout = new VerticalPanel();
    layout.setStyleName("fill-layout-width");

    stack = new VerticalPanel();
    stack.setStyleName("fill-layout-width");
    stack.getElement().getStyle().setBackgroundColor("#ffffff");

    // ----------------------------------------------------

    subsystemTree = new LHSNavTree("profiles");
    subsystemTree.getElement().setAttribute("style", "padding: 5px;");
    subsystemTree.getElement().setAttribute("aria-label", "Profile Tasks");

    // ----------------------------------------------------

    LHSNavTree commonTree = new LHSNavTree(Console.CONSTANTS.common_label_generalConfig());

    LHSNavTreeItem[] commonItems = new LHSNavTreeItem[] {
            /*new LHSNavTreeItem("Server", NameTokens.StandaloneServerPresenter),*/
            new LHSNavTreeItem(Console.CONSTANTS.common_label_interfaces(), NameTokens.InterfacePresenter),
            new LHSNavTreeItem(Console.CONSTANTS.common_label_socketBinding(), NameTokens.SocketBindingPresenter),
            new LHSNavTreeItem(Console.CONSTANTS.common_label_paths(), NameTokens.PathManagementPresenter),
            new LHSNavTreeItem(Console.CONSTANTS.common_label_systemProperties(), NameTokens.PropertiesPresenter),
    };

    for(LHSNavTreeItem item : commonItems)
    {
        commonTree.addItem(item);
    }


    subsystemTree.expandTopLevel();

    HTML title = new HTML("Subsystems");
    title.setStyleName("server-picker-section-header");

    stack.add(title);
    stack.add(subsystemTree);

    layout.add(stack);


    HTML commonTitle = new HTML("General Configuration");
    commonTitle.setStyleName("server-picker-section-header");
    stack.add(commonTitle);

    stack.add(commonTree);

    scroll = new ScrollPanel(layout);

}
 
Example 20
Source File: AcceptorOverview.java    From core with GNU Lesser General Public License v2.1 2 votes vote down vote up
Widget asWidget() {

        LayoutPanel layout = new LayoutPanel();

        VerticalPanel panel = new VerticalPanel();
        panel.setStyleName("rhs-content-panel");

        ScrollPanel scroll = new ScrollPanel(panel);
        layout.add(scroll);

        layout.setWidgetTopHeight(scroll, 0, Style.Unit.PX, 100, Style.Unit.PCT);

        // ---

        serverName = new HTML(Console.CONSTANTS.replace_me());
        serverName.setStyleName("content-header-label");


        HorizontalPanel header = new HorizontalPanel();
        header.setStyleName("fill-layout-width");
        header.add(serverName);

        // ----

        final DeckPanel deck = new DeckPanel();
        deck.addStyleName("fill-layout");

        final ListBox selector = new ListBox();

        selector.addItem("Type: Remote");
        selector.addItem("Type: In-VM");
        selector.addItem("Type: Generic");

        selector.addChangeHandler(new ChangeHandler() {
            @Override
            public void onChange(ChangeEvent changeEvent) {
                deck.showWidget(selector.getSelectedIndex());
            }
        });

        header.add(selector);
        selector.getElement().getParentElement().setAttribute("align", "right");


        panel.add(header);
        panel.add(new ContentDescription(Console.CONSTANTS.hornetq_acceptor_type_desc()));

        genericAcceptors = new AcceptorList(presenter, AcceptorType.GENERIC);
        remoteAcceptors = new AcceptorList(presenter, AcceptorType.REMOTE);
        invmAcceptors = new AcceptorList(presenter, AcceptorType.INVM);

        deck.add(remoteAcceptors.asWidget());
        deck.add(invmAcceptors.asWidget());
        deck.add(genericAcceptors.asWidget());

        deck.showWidget(0);

        panel.add(deck);

        return layout;
    }