Search in sources :

Example 6 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)

Example 7 with FlowPanel

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

the class ActionPopupButton method renderImage.

/**
     * Redraw the icon.
     */
private void renderImage() {
    panel.clear();
    if (presentation.getImageResource() != null) {
        Image image = new Image(presentationFactory.getPresentation(action).getImageResource());
        image.setStyleName(toolbarResources.toolbar().popupButtonIcon());
        panel.add(image);
    } else if (presentation.getSVGResource() != null) {
        SVGImage image = new SVGImage(presentation.getSVGResource());
        image.getElement().setAttribute("class", toolbarResources.toolbar().popupButtonIcon());
        panel.add(image);
    } else if (presentation.getHTMLResource() != null) {
        FlowPanel icon = new FlowPanel();
        icon.setStyleName(toolbarResources.toolbar().iconButtonIcon());
        FlowPanel inner = new FlowPanel();
        inner.setStyleName(toolbarResources.toolbar().popupButtonIconInner());
        inner.getElement().setInnerHTML(presentation.getHTMLResource());
        icon.add(inner);
        panel.add(inner);
    }
    InlineLabel caret = new InlineLabel("");
    caret.setStyleName(toolbarResources.toolbar().caret());
    panel.add(caret);
}
Also used : FlowPanel(com.google.gwt.user.client.ui.FlowPanel) InlineLabel(com.google.gwt.user.client.ui.InlineLabel) SVGImage(org.vectomatic.dom.svg.ui.SVGImage) Image(com.google.gwt.user.client.ui.Image) SVGImage(org.vectomatic.dom.svg.ui.SVGImage)

Example 8 with FlowPanel

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

the class ToolbarViewImpl method createToolbarPart.

/**
     * Creates a toolbar part widget.
     *
     * @return widget
     */
private Widget createToolbarPart(List<Utils.VisibleActionGroup> visibleActionGroupList) {
    FlowPanel toolbarPart = new FlowPanel();
    if (addSeparatorFirst) {
        final Widget firstDelimiter = createDelimiter();
        toolbarPart.add(firstDelimiter);
    }
    for (Utils.VisibleActionGroup visibleActionGroup : visibleActionGroupList) {
        List<Action> actions = visibleActionGroup.getActionList();
        if (actions == null || actions.size() == 0) {
            continue;
        }
        FlowPanel actionGroupPanel = new FlowPanel();
        actionGroupPanel.setStyleName(toolbarResources.toolbar().toolbarActionGroupPanel());
        toolbarPart.add(actionGroupPanel);
        for (Action action : actions) {
            if (action instanceof Separator) {
                int actionIndex = actions.indexOf(action);
                if (actionIndex > 0 && actionIndex < actions.size() - 1) {
                    final Widget delimiter = createDelimiter();
                    actionGroupPanel.add(delimiter);
                }
            } else if (action instanceof CustomComponentAction) {
                Presentation presentation = presentationFactory.getPresentation(action);
                Widget customComponent = ((CustomComponentAction) action).createCustomComponent(presentation);
                actionGroupPanel.add(customComponent);
            } else if (action instanceof ActionGroup && ((ActionGroup) action).isPopup()) {
                ActionPopupButton button = new ActionPopupButton((ActionGroup) action, actionManager, keyBindingAgent, presentationFactory, managerProvider, toolbarResources);
                actionGroupPanel.add(button);
            } else {
                final ActionButton button = createToolbarButton(action);
                actionGroupPanel.add(button);
            }
        }
    }
    return toolbarPart;
}
Also used : Action(org.eclipse.che.ide.api.action.Action) CustomComponentAction(org.eclipse.che.ide.api.action.CustomComponentAction) CustomComponentAction(org.eclipse.che.ide.api.action.CustomComponentAction) Widget(com.google.gwt.user.client.ui.Widget) Presentation(org.eclipse.che.ide.api.action.Presentation) ActionGroup(org.eclipse.che.ide.api.action.ActionGroup) FlowPanel(com.google.gwt.user.client.ui.FlowPanel) Separator(org.eclipse.che.ide.api.action.Separator)

Example 9 with FlowPanel

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

the class ToolbarViewImpl method createDelimiter.

/**
     * Creates a delimiter widget.
     *
     * @return widget
     */
private Widget createDelimiter() {
    FlowPanel delimiter = new FlowPanel();
    delimiter.setStyleName(toolbarResources.toolbar().toolbarDelimiter());
    return delimiter;
}
Also used : FlowPanel(com.google.gwt.user.client.ui.FlowPanel)

Example 10 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)

Aggregations

FlowPanel (com.google.gwt.user.client.ui.FlowPanel)81 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)18 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)15 Button (com.google.gwt.user.client.ui.Button)14 Label (com.google.gwt.user.client.ui.Label)12 Grid (com.google.gwt.user.client.ui.Grid)10 VerticalPanel (com.google.gwt.user.client.ui.VerticalPanel)8 HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)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 Widget (com.google.gwt.user.client.ui.Widget)6 Test (org.junit.Test)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 IsWidget (com.google.gwt.user.client.ui.IsWidget)5 List (java.util.List)4