Search in sources :

Example 1 with FlowPanel

use of com.google.gwt.user.client.ui.FlowPanel in project che by eclipse.

the class ExpandEditorAction method createCustomComponent.

@Override
public Widget createCustomComponent(Presentation presentation) {
    if (buttonPanel != null) {
        return buttonPanel;
    }
    final Element tooltip = DOM.createSpan();
    tooltip.setInnerHTML(constant.actionExpandEditorTitle());
    buttonPanel = new FlowPanel();
    buttonPanel.addStyleName(resources.coreCss().editorFullScreen());
    button = new FlowPanel();
    button.getElement().setInnerHTML(FontAwesome.EXPAND);
    button.addDomHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            toggleExpand();
        }
    }, ClickEvent.getType());
    buttonPanel.add(button);
    buttonPanel.getElement().appendChild(tooltip);
    buttonPanel.addDomHandler(new MouseOverHandler() {

        @Override
        public void onMouseOver(MouseOverEvent event) {
            final Element panel = event.getRelativeElement();
            tooltip.getStyle().setProperty("top", (panel.getAbsoluteTop() + panel.getOffsetHeight() + 9) + "px");
            tooltip.getStyle().setProperty("right", (Document.get().getClientWidth() - panel.getAbsoluteRight() - 2) + "px");
        }
    }, MouseOverEvent.getType());
    return buttonPanel;
}
Also used : ClickHandler(com.google.gwt.event.dom.client.ClickHandler) Element(com.google.gwt.dom.client.Element) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) MouseOverEvent(com.google.gwt.event.dom.client.MouseOverEvent) FlowPanel(com.google.gwt.user.client.ui.FlowPanel) MouseOverHandler(com.google.gwt.event.dom.client.MouseOverHandler)

Example 2 with FlowPanel

use of com.google.gwt.user.client.ui.FlowPanel in project che by eclipse.

the class EditorPaneMenuWidget method addItem.

/** {@inheritDoc} */
@Override
public void addItem(@NotNull EditorPaneMenuItem item, boolean isSeparated) {
    FlowPanel targetPanel = item instanceof PaneMenuActionItemWidget ? actionsPanel : itemsPanel;
    targetPanel.add(item);
    if (isSeparated) {
        targetPanel.add(getDelimiter());
    }
}
Also used : FlowPanel(com.google.gwt.user.client.ui.FlowPanel)

Example 3 with FlowPanel

use of com.google.gwt.user.client.ui.FlowPanel in project che by eclipse.

the class EditorPaneMenuWidget method removeItem.

/** {@inheritDoc} */
@Override
public void removeItem(@NotNull EditorPaneMenuItem item) {
    FlowPanel targetPanel = item instanceof PaneMenuActionItemWidget ? actionsPanel : itemsPanel;
    targetPanel.remove(item);
}
Also used : FlowPanel(com.google.gwt.user.client.ui.FlowPanel)

Example 4 with FlowPanel

use of com.google.gwt.user.client.ui.FlowPanel in project che by eclipse.

the class PartButtonWidget method getBadge.

/**
     * Creates a badge widget with a message
     *
     * @param messages
     *         messages count
     * @return new badge widget
     */
private Widget getBadge(int messages) {
    FlowPanel w = new FlowPanel();
    Style s = w.getElement().getStyle();
    s.setProperty("position", "absolute");
    s.setProperty("width", "12px");
    s.setProperty("height", "12px");
    s.setProperty("boxSizing", "border-box");
    s.setProperty("borderRadius", "8px");
    s.setProperty("textAlign", "center");
    s.setProperty("color", org.eclipse.che.ide.api.theme.Style.getBadgeFontColor());
    s.setProperty("left", "15px");
    s.setProperty("top", "3px");
    s.setProperty("borderWidth", "1.5px");
    s.setProperty("borderStyle", "solid");
    s.setProperty("fontFamily", "'Helvetica Neue', 'Myriad Pro', arial, Verdana, Verdana, sans-serif");
    s.setProperty("fontSize", "9.5px");
    s.setProperty("fontWeight", "bold");
    s.setProperty("textShadow", "none");
    s.setProperty("backgroundColor", org.eclipse.che.ide.api.theme.Style.getBadgeBackgroundColor());
    w.setStyleName("bounceOutUp");
    if (messages > 9) {
        s.setProperty("lineHeight", "5px");
        w.getElement().setInnerHTML("...");
    } else {
        s.setProperty("lineHeight", "10px");
        w.getElement().setInnerHTML("" + messages);
    }
    return w;
}
Also used : FlowPanel(com.google.gwt.user.client.ui.FlowPanel) Style(com.google.gwt.dom.client.Style)

Example 5 with FlowPanel

use of com.google.gwt.user.client.ui.FlowPanel in project che by eclipse.

the class RedirectToDashboardAction method createCustomComponent.

@Override
public Widget createCustomComponent(Presentation presentation) {
    FlowPanel panel = new FlowPanel();
    panel.setWidth("24px");
    panel.setHeight("24px");
    arrow = DOM.createAnchor();
    arrow.setClassName(resources.dashboardCSS().dashboardArrow());
    arrow.setInnerHTML("<i class=\"fa fa-chevron-right\" />");
    panel.getElement().appendChild(arrow);
    arrow.setAttribute("href", constant.openDashboardUrlWorkspace(appContext.getWorkspace().getConfig().getName()));
    arrow.setAttribute("target", "_blank");
    Tooltip.create((elemental.dom.Element) arrow, BOTTOM, RIGHT, constant.openDashboardToolbarButtonTitle());
    return panel;
}
Also used : FlowPanel(com.google.gwt.user.client.ui.FlowPanel)

Aggregations

FlowPanel (com.google.gwt.user.client.ui.FlowPanel)68 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)15 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)15 Button (com.google.gwt.user.client.ui.Button)14 Grid (com.google.gwt.user.client.ui.Grid)10 Label (com.google.gwt.user.client.ui.Label)7 SmallHeading (com.google.gerrit.client.ui.SmallHeading)6 Element (com.google.gwt.dom.client.Element)6 CheckBox (com.google.gwt.user.client.ui.CheckBox)6 CellFormatter (com.google.gwt.user.client.ui.HTMLTable.CellFormatter)6 InlineLabel (com.google.gwt.user.client.ui.InlineLabel)6 ComplexPanel (com.google.gwt.user.client.ui.ComplexPanel)5 HTML (com.google.gwt.user.client.ui.HTML)5 Image (com.google.gwt.user.client.ui.Image)5 VerticalPanel (com.google.gwt.user.client.ui.VerticalPanel)5 Test (org.junit.Test)5 HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)4 ActionButton (com.google.gerrit.client.actions.ActionButton)3 AccountInfo (com.google.gerrit.client.info.AccountInfo)3 NativeString (com.google.gerrit.client.rpc.NativeString)3