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;
}
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);
}
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;
}
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;
}
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;
}
Aggregations