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

The following examples show how to use com.google.gwt.user.client.ui.HorizontalPanel#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: DebugPanelFilterWidget.java    From core with GNU Lesser General Public License v2.1 6 votes vote down vote up
public DebugPanelFilterWidget(DebugPanelFilterModel model) {
  HorizontalPanel panel = new HorizontalPanel();
  panel.add(button = Utils.createMenuButton("Add/Edit Filter", null));
  panel.add(new DebugPanelFilterTrail(model));
  panel.setStyleName(Utils.style() + "-filters");
  initWidget(panel);

  popup = new FilterPopup(model);
  button.addClickHandler(new ClickHandler() {
    //@Override
    public void onClick(ClickEvent event) {
      popup.setPopupPositionAndShow(new PopupPanel.PositionCallback() {
        //@Override
        public void setPosition(int offsetWidth, int offsetHeight) {
          popup.setPopupPosition(
              button.getAbsoluteLeft(), button.getAbsoluteTop() + button.getOffsetHeight())
          ;

        }
      });
    }
  });
}
 
Example 2
Source File: BasicToolBar.java    From geowe-core with GNU General Public License v3.0 6 votes vote down vote up
private void initializew3wPanel() {
	w3wPanel = new HorizontalPanel();
	w3wPanel.setSpacing(5);
	w3wPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
	StyleInjector.inject(".w3wPanel { " + "background: #E0ECF8;"
			+ "border-radius: 5px 10px;" + "opacity: 0.8}");
	w3wPanel.setStyleName("w3wPanel");
	w3wPanel.setWidth("415px");

	wordsLabel = new Label();
	w3wAnchor = new AnchorBuilder().setHref("https://what3words.com/")
			.setText(UIMessages.INSTANCE.what3Words())
			.setTitle("https://what3words.com/").build();
	w3wAnchor.getElement().getStyle().setColor("#FF0000");
	w3wAnchor.setVisible(false);
	w3wPanel.add(w3wAnchor);
	w3wPanel.add(wordsLabel);
}
 
Example 3
Source File: DialogBox.java    From incubator-retired-wave with Apache License 2.0 6 votes vote down vote up
/**
 * Creates dialog box.
 *
 * @param popup - UniversalPopup on which the dialog is based
 * @param title - title placed in the title bar
 * @param innerWidget - the inner widget of the dialog
 * @param dialogButtons - buttons
 */
static public void create(UniversalPopup popup, String title, Widget innerWidget, DialogButton[] dialogButtons) {
  // Title
  popup.getTitleBar().setTitleText(title);

  VerticalPanel contents = new VerticalPanel();
  popup.add(contents);

  // Message
  contents.add(innerWidget);

  // Buttons
  HorizontalPanel buttonPanel = new HorizontalPanel();
  for(DialogButton dialogButton : dialogButtons) {
    Button button = new Button(dialogButton.getTitle());
    button.setStyleName(Dialog.getCss().dialogButton());
    buttonPanel.add(button);
    dialogButton.link(button);
  }
  contents.add(buttonPanel);
  buttonPanel.setStyleName(Dialog.getCss().dialogButtonPanel());
  contents.setCellHorizontalAlignment(buttonPanel, HasHorizontalAlignment.ALIGN_RIGHT);
}
 
Example 4
Source File: WebTable.java    From unitime with Apache License 2.0 6 votes vote down vote up
public IconCell(ImageResource resource, final String title, String text) {
	super(null);
	iIcon = new Image(resource);
	iIcon.setTitle(title);
	iIcon.setAltText(title);
	if (text != null && !text.isEmpty()) {
		iLabel = new HTML(text, false);
		iPanel = new HorizontalPanel();
		iPanel.setStyleName("icon");
		iPanel.add(iIcon);
		iPanel.add(iLabel);
		iIcon.getElement().getStyle().setPaddingRight(3, Unit.PX);
		iPanel.setCellVerticalAlignment(iIcon, HasVerticalAlignment.ALIGN_MIDDLE);
	}
	if (title != null && !title.isEmpty()) {
		iIcon.addClickHandler(new ClickHandler() {
			@Override
			public void onClick(ClickEvent event) {
				event.stopPropagation();
				UniTimeConfirmationDialog.info(title);
			}
		});
	}
}
 
Example 5
Source File: DialogBox.java    From swellrt with Apache License 2.0 6 votes vote down vote up
/**
 * Creates dialog box.
 *
 * @param popup - UniversalPopup on which the dialog is based
 * @param title - title placed in the title bar
 * @param innerWidget - the inner widget of the dialog
 * @param dialogButtons - buttons
 */
static public void create(UniversalPopup popup, String title, Widget innerWidget, DialogButton[] dialogButtons) {
  // Title
  popup.getTitleBar().setTitleText(title);

  VerticalPanel contents = new VerticalPanel();
  popup.add(contents);

  // Message
  contents.add(innerWidget);

  // Buttons
  HorizontalPanel buttonPanel = new HorizontalPanel();
  for(DialogButton dialogButton : dialogButtons) {
    Button button = new Button(dialogButton.getTitle());
    button.setStyleName(Dialog.getCss().dialogButton());
    buttonPanel.add(button);
    dialogButton.link(button);
  }
  contents.add(buttonPanel);
  buttonPanel.setStyleName(Dialog.getCss().dialogButtonPanel());
  contents.setCellHorizontalAlignment(buttonPanel, HasHorizontalAlignment.ALIGN_RIGHT);
}
 
Example 6
Source File: ServerSwitch.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
public Widget asWidget() {
    HorizontalPanel layout = new HorizontalPanel();
    layout.setStyleName("fill-layout-width");

    layout.add(new ContentHeaderLabel("Transaction Metrics"));

    serverSelection= new ComboBox();
    serverSelection.addValueChangeHandler(new ValueChangeHandler<String>() {
        @Override
        public void onValueChange(ValueChangeEvent<String> event) {

        }
    });

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

    Label label = new Label("Server: ");
    label.setStyleName("header-label");
    inner.add(label);
    label.getElement().getParentElement().setAttribute("align", "right");

    Widget widget = serverSelection.asWidget();
    inner.add(widget);
    widget.getElement().getParentElement().setAttribute("with", "100%");

    layout.add(inner);

    return layout;
}
 
Example 7
Source File: RBACContextView.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
private Widget asWidget() {
    VerticalPanel container = new VerticalPanel();
    container.setStyleName("fill-layout");

    HorizontalPanel menu = new HorizontalPanel();
    menu.setStyleName("fill-layout-width");
    final TextBox nameBox = new TextBox();
    nameBox.setText(securityFramework.resolveToken());

    MultiWordSuggestOracle oracle = new  MultiWordSuggestOracle();
    oracle.addAll(Console.MODULES.getRequiredResourcesRegistry().getTokens());

    SuggestBox suggestBox = new SuggestBox(oracle, nameBox);

    Button btn = new Button("Show", new ClickHandler() {
        @Override
        public void onClick(ClickEvent clickEvent) {
            container.clear();

            try {
                container.add(createContent(nameBox.getText()));
            } catch (Throwable e) {
                HTML msg = new HTML(e.getMessage());
                msg.getElement().getStyle().setColor("red");
                container.add(msg);
            }
        }
    });
    menu.add(new HTML("Token: "));
    menu.add(suggestBox);
    menu.add(btn);


    VerticalPanel p = new VerticalPanel();
    p.setStyleName("fill-layout-width");
    p.add(menu);
    p.add(container);
    return p;
}
 
Example 8
Source File: WebTable.java    From unitime with Apache License 2.0 5 votes vote down vote up
public InstructorCell(ArrayList<String> names, ArrayList<String> emails, String separator) {
	super(null, separator);
	if (names != null && !names.isEmpty()) {
		separator = separator.replace(" ", "&nbsp;");
		for (int i = 0; i < names.size(); i++) {
			String text = names.get(i) + (i + 1 < names.size() ? separator : "");
			String email = (emails != null && i < emails.size() ? emails.get(i) : null);
			if (email != null && !email.isEmpty()) {
				iText += text;
				HorizontalPanel p = new HorizontalPanel();
				p.setStyleName("instructor");
				Anchor a = new Anchor();
				a.setHref("mailto:" + email);
				a.setHTML(new Image(RESOURCES.email()).getElement().getString());
				a.setTitle(MESSAGES.sendEmail(names.get(i)));
				a.setStyleName("unitime-SimpleLink");
				a.addClickHandler(new ClickHandler() {
					public void onClick(ClickEvent event) {
						event.stopPropagation();
					}
				});
				p.add(a);
				p.setCellVerticalAlignment(a, HasVerticalAlignment.ALIGN_MIDDLE);
				HTML h = new HTML(text, false);
				h.getElement().getStyle().setMarginLeft(2, Unit.PX);
				p.add(h);
				iPanel.add(p);
				iContent.add(h);
			} else
				add(text);
		}
	} else {
		add("&nbsp;");
	}
}
 
Example 9
Source File: WebTable.java    From unitime with Apache License 2.0 5 votes vote down vote up
public IconCell(ImageResource resource, final String title, String text, boolean reverse) {
	super(null);
	iIcon = new Image(resource);
	iIcon.setTitle(title);
	iIcon.setAltText(title);
	if (text != null && !text.isEmpty()) {
		iLabel = new HTML(text, false);
		iPanel = new HorizontalPanel();
		iPanel.setStyleName("icon");
		if (reverse) {
			iPanel.add(iLabel);
			iPanel.add(iIcon);
			iLabel.getElement().getStyle().setPaddingRight(3, Unit.PX);
			iLabel.setWidth("100%");
			iPanel.setWidth("100%");
			iIcon.getElement().getStyle().setFloat(Float.RIGHT);
		} else {
			iPanel.add(iIcon);
			iPanel.add(iLabel);
			iIcon.getElement().getStyle().setPaddingRight(3, Unit.PX);
		}
		iPanel.setCellVerticalAlignment(iIcon, HasVerticalAlignment.ALIGN_MIDDLE);
	}
	if (title != null && !title.isEmpty()) {
		iIcon.addClickHandler(new ClickHandler() {
			@Override
			public void onClick(ClickEvent event) {
				event.stopPropagation();
				UniTimeConfirmationDialog.info(title);
			}
		});
	}
}
 
Example 10
Source File: LinksWidget.java    From geowe-core with GNU General Public License v3.0 5 votes vote down vote up
@Override
public Widget asWidget() {
	if (widget == null) {
		//String width="320px";
		String width="370px";
		String height="50px";
		widget = new HorizontalLayoutContainer();
		widget.getElement().getStyle().setPosition(Position.ABSOLUTE);
		widget.getElement().getStyle().setRight(5, Unit.PX);
		widget.getElement().getStyle().setTop(0, Unit.PX);
		widget.setSize(width, height);
		
		hp = new HorizontalPanel();
		hp.setSpacing(10);
		StyleInjector.inject(".linkPanel { " + "background: #FFFFFF;"
				+ "border-radius: 5px 10px;" + "opacity: 0.8}");
		hp.setStyleName("linkPanel");
		hp.setSize(width, height);
		
		ScrollSupport scrollSupport = widget.getScrollSupport();
		scrollSupport.setScrollMode(ScrollMode.AUTOX);
		
		setDefaultLinks();
		
		widget.add(hp);
	}
	return widget;
}
 
Example 11
Source File: JobDescPopupPanel.java    From EasyML with Apache License 2.0 5 votes vote down vote up
public JobDescPopupPanel(String title) {

		Label label = new Label(title);
		label.setStyleName("bda-newjob-head");
		verticalPanel.add(label);
		verticalPanel.add(createGrid());
		HorizontalPanel hpanel = new HorizontalPanel();

		hpanel.setStyleName("bda-newjob-hpanel");
		verticalPanel.add(errorLabel);
		Button cancelBtn = new Button(Constants.studioUIMsg.cancel());
		cancelBtn.addClickHandler(new ClickHandler() {

			@Override
			public void onClick(ClickEvent event) {
				JobDescPopupPanel.this.hide();
			}

		});

		hpanel.add(submitBtn);
		hpanel.add(cancelBtn);
		submitBtn.removeStyleName("gwt-Button");
		cancelBtn.removeStyleName("gwt-Button");
		submitBtn.addStyleName("button-style");
		cancelBtn.addStyleName("button-style");
		errorLabel.setStyleName("error-label");
		verticalPanel.add(hpanel);
		verticalPanel.addStyleName("bda-newjob");
		this.setCloseEnable(false);
	}
 
Example 12
Source File: WebTable.java    From unitime with Apache License 2.0 4 votes vote down vote up
public IconsCell() {
	super(null);
	iPanel = new HorizontalPanel();
	iPanel.setStyleName("icons");
}
 
Example 13
Source File: DataTypeSelectPanel.java    From EasyML with Apache License 2.0 4 votes vote down vote up
/**
 * UI initialization
 */
public void init()
{
	this.setSize("480px", "100px");

	//Dialog box title
	closeButton.setSize("10px", "10px");
	closeButton.setStyleName("closebtn");

	//Selection dialog
	HorizontalPanel typeListPanel = new HorizontalPanel();
	typeListPanel.setStyleName("popupDatatypeSelectPanel");
	typeListBox = new ListBox();
	typeListBox.setWidth("120px");
	typeListBox.addItem("----");
	typeListBox.addItem(DatasetType.GENERAL.getDesc());
	typeListBox.addItem(DatasetType.CSV.getDesc());
	typeListBox.addItem(DatasetType.TSV.getDesc());
	typeListBox.addItem(DatasetType.JSON.getDesc());
	if(dataset.getContenttype() == null || dataset.getContenttype() .equals(""))
		typeListBox.setSelectedIndex(0);
	else
	{
		for(int i = 0 ; i<typeListBox.getItemCount() ; i++)
		{
			if(typeListBox.getItemText(i).equals(dataset.getContenttype()))
			{
				typeListBox.setSelectedIndex(i);
				break;
			}
		}
	}
	Label selectLabel = new Label("Select data type: ");
	typeListPanel.add(selectLabel);
	typeListPanel.add(typeListBox);

	//Ok and cancel button
	HorizontalPanel buttonPanel = new HorizontalPanel();
	buttonPanel.setStyleName("popupDatatypeButtonPanel");
	okBtn = new Button("Ok");
	okBtn.setStyleName("button-style");
	cancelBtn = new Button("Cancel");
	cancelBtn.setStyleName("button-style");
	buttonPanel.add(okBtn);
	buttonPanel.add(cancelBtn);

	//Overall arrangement
	VerticalPanel topPanel = new VerticalPanel();
	topPanel.add(closeButton);
	topPanel.setCellHeight(closeButton, "13px");
	topPanel.setStyleName("vpanel");
	desc.setStyleName("popupDatatypeSelectTitle");
	topPanel.add(desc);
	topPanel.setCellHeight(desc, "30px");
	topPanel.add(typeListPanel);
	topPanel.add(buttonPanel);

	this.setGlassEnabled(true);
	this.setModal(true);
	this.add(topPanel);
	this.center();
	this.setStyleName("loading-panel");
}
 
Example 14
Source File: BulletGraphView.java    From core with GNU Lesser General Public License v2.1 4 votes vote down vote up
@Override
public Widget asWidget() {

    VerticalPanel desc = new VerticalPanel();
    desc.addStyleName("metric-container");
    if(embeddedUse)
        desc.add(new HTML("<h3 class='metric-label-embedded'>" + title + "</h3>"));
    else
        desc.add(new HTML("<h3 class='metric-label'>" + title + "</h3>"));

    container = new HorizontalPanel();
    container.setStyleName("fill-layout-width");
    container.addStyleName("metric-panel");


    grid = new Grid(columns.length, 2);
    grid.addStyleName("metric-grid");

    // format
    for (int row = 0; row < columns.length; ++row) {
        grid.getCellFormatter().addStyleName(row, 0,  "nominal");
        grid.getCellFormatter().addStyleName(row, 1, "numerical");
    }

    int baselineIndex = getBaseLineIndex();
    if(baselineIndex>=0)
        grid.getRowFormatter().addStyleName(baselineIndex, "baseline");

    // init
    for(int i=0; i<columns.length;i++)
    {
        grid.setText(i, 0, columns[i].label);
        grid.setText(i, 1, "0");
    }


    container.add(grid);

    ProtovisWidget graphWidget = new ProtovisWidget();
    graphWidget.initPVPanel();
    vis = createVisualization(graphWidget);

    Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
        @Override
        public void execute() {
            renderDefault();    // the 'empty' display
        }
    });

    if (address != null) {
        MetricHelpPanel helpPanel = new MetricHelpPanel(address, this.columns);
        desc.add(helpPanel.asWidget());
    }

    container.add(graphWidget);
    graphWidget.getElement().getParentElement().setAttribute("align", "center");
    graphWidget.getElement().getParentElement().setAttribute("width", "80%");

    desc.add(container);

    return desc;
}
 
Example 15
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 16
Source File: HelpDialog.java    From circuitjs1 with GNU General Public License v2.0 4 votes vote down vote up
HelpDialog() {
	super();
	vp = new VerticalPanel();
	setWidget(vp);
	setText(sim.LS("Help"));

	TabPanel tp = new TabPanel();
	vp.add(tp);
	String tab1Title = "EN";
	String tab2Title = "RU";
	String tab3Title = "PL";
	String tab4Title = "DE";
	String tab5Title = "DA";

	      //create tabs 
	tp.add(vpEN = new VerticalPanel(), tab1Title);
	vpEN.setWidth("500px");
	vpEN.add(new HTML("<iframe style=\"border:0;\" src=\"help/EN.html\" width=\"500\" height=\"400\" scrolling=\"auto\" frameborder=\"1\"></iframe>"));
	
	tp.add(vpRU = new VerticalPanel(), tab2Title);
	vpRU.setWidth("500px");
	vpRU.add(new HTML("<iframe style=\"border:0;\" src=\"help/RU.html\" width=\"500\" height=\"400\" scrolling=\"auto\" frameborder=\"1\"></iframe>"));

	tp.add(vpPL = new VerticalPanel(), tab3Title);
	vpPL.setWidth("500px");
	vpPL.add(new HTML("<iframe style=\"border:0;\" src=\"help/PL.html\" width=\"500\" height=\"400\" scrolling=\"auto\" frameborder=\"1\"></iframe>"));

	tp.add(vpDE = new VerticalPanel(), tab4Title);
	vpDE.setWidth("500px");
	vpDE.add(new HTML("<iframe style=\"border:0;\" src=\"help/DE.html\" width=\"500\" height=\"400\" scrolling=\"auto\" frameborder=\"1\"></iframe>"));

	tp.add(vpDA = new VerticalPanel(), tab5Title);
	vpDA.setWidth("500px");
	vpDA.add(new HTML("<iframe style=\"border:0;\" src=\"help/DA.html\" width=\"500\" height=\"400\" scrolling=\"auto\" frameborder=\"1\"></iframe>"));
	
	HorizontalPanel hp = new HorizontalPanel();
	hp.setWidth("100%");
	hp.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
	hp.setStyleName("topSpace");
	
	//select first tab
	tp.selectTab(0);

	//set width if tabpanel
	tp.setWidth("500");
	
	vp.add(hp);
	hp.add(okButton = new Button("OK"));
	okButton.addClickHandler(new ClickHandler() {
		public void onClick(ClickEvent event) {
			closeDialog();
		}
	});
	center();
	show();
}
 
Example 17
Source File: ConnectorOverview.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("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.jmsConnectorDescription()));

        genericConnectors = new ConnectorList(presenter, ConnectorType.GENERIC);
        remoteConnectors = new ConnectorList(presenter, ConnectorType.REMOTE);
        invmConnectors = new ConnectorList(presenter, ConnectorType.INVM);

        deck.add(remoteConnectors.asWidget());
        deck.add(invmConnectors.asWidget());
        deck.add(genericConnectors.asWidget());

        deck.showWidget(0);

        panel.add(deck);

        return layout;
    }
 
Example 18
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 19
Source File: ConnectorOverview.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("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.jmsConnectorDescription()));

        genericConnectors = new ConnectorList(presenter, ConnectorType.GENERIC);
        remoteConnectors = new ConnectorList(presenter, ConnectorType.REMOTE);
        invmConnectors = new ConnectorList(presenter, ConnectorType.INVM);

        deck.add(remoteConnectors.asWidget());
        deck.add(invmConnectors.asWidget());
        deck.add(genericConnectors.asWidget());

        deck.showWidget(0);

        panel.add(deck);

        return 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;
    }