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