Search in sources :

Example 81 with Image

use of com.google.gwt.user.client.ui.Image in project perun by CESNET.

the class UserExtSourceDetailTabItem method draw.

public Widget draw() {
    this.titleWidget.setText(Utils.getStrippedStringWithEllipsis(userExtSource.getLogin().trim()));
    // MAIN TAB PANEL
    VerticalPanel vp = new VerticalPanel();
    vp.setSize("100%", "100%");
    // The table
    AbsolutePanel dp = new AbsolutePanel();
    //dp.setStyleName("decoration");
    final FlexTable menu = new FlexTable();
    menu.setCellSpacing(5);
    menu.setWidget(0, 0, new Image(LargeIcons.INSTANCE.worldIcon()));
    Label memberName = new Label();
    memberName.setText(Utils.getStrippedStringWithEllipsis(userExtSource.getLogin(), 40));
    memberName.setStyleName("now-managing");
    memberName.setTitle(userExtSource.getLogin());
    menu.setWidget(0, 1, memberName);
    int column = 2;
    menu.setHTML(0, column, " ");
    menu.getFlexCellFormatter().setWidth(0, column, "25px");
    column++;
    if (JsonUtils.isExtendedInfoVisible()) {
        menu.setHTML(0, column, "<strong>UES ID:</strong><br/><span class=\"inputFormInlineComment\">" + userExtSource.getId() + "</span>");
        column++;
        menu.setHTML(0, column, "&nbsp;");
        menu.getFlexCellFormatter().setWidth(0, column, "25px");
        column++;
        menu.setHTML(0, column, "<strong>ES name:</strong><br/><span class=\"inputFormInlineComment\">" + userExtSource.getExtSource().getName() + "</span>");
        column++;
        menu.setHTML(0, column, "&nbsp;");
        menu.getFlexCellFormatter().setWidth(0, column, "25px");
        column++;
        menu.setHTML(0, column, "<strong>ES type:</strong><br/><span class=\"inputFormInlineComment\">" + userExtSource.getExtSource().getType() + "</span>");
    }
    dp.add(menu);
    vp.add(dp);
    vp.setCellHeight(dp, "30px");
    tabPanel.clear();
    tabPanel.add(new UserExtSourceSettingsTabItem(userExtSource), "Settings");
    // Resize must be called after page fully displays
    Scheduler.get().scheduleDeferred(new Command() {

        @Override
        public void execute() {
            tabPanel.finishAdding();
        }
    });
    vp.add(tabPanel);
    this.contentWidget.setWidget(vp);
    return getWidget();
}
Also used : VerticalPanel(com.google.gwt.user.client.ui.VerticalPanel) Command(com.google.gwt.user.client.Command) FlexTable(com.google.gwt.user.client.ui.FlexTable) Label(com.google.gwt.user.client.ui.Label) AbsolutePanel(com.google.gwt.user.client.ui.AbsolutePanel) Image(com.google.gwt.user.client.ui.Image)

Example 82 with Image

use of com.google.gwt.user.client.ui.Image in project drools-wb by kiegroup.

the class ActionValueEditor method wrap.

// Wrap a Constraint Value Editor with an icon to remove the type
private Widget wrap(Widget w) {
    HorizontalPanel wrapper = new HorizontalPanel();
    Image clear = GuidedRuleEditorImages508.INSTANCE.DeleteItemSmall();
    clear.setAltText(GuidedRuleEditorResources.CONSTANTS.RemoveActionValueDefinition());
    clear.setTitle(GuidedRuleEditorResources.CONSTANTS.RemoveActionValueDefinition());
    clear.addClickHandler(new ClickHandler() {

        public void onClick(ClickEvent event) {
            // Reset Constraint's value and value type
            if (Window.confirm(GuidedRuleEditorResources.CONSTANTS.RemoveActionValueDefinitionQuestion())) {
                value.setNature(FieldNatureType.TYPE_UNDEFINED);
                value.setValue(null);
                doTypeChosen();
            }
        }
    });
    wrapper.add(w);
    if (!this.readOnly) {
        wrapper.add(clear);
        wrapper.setCellVerticalAlignment(clear, HasVerticalAlignment.ALIGN_MIDDLE);
    }
    return wrapper;
}
Also used : ClickHandler(com.google.gwt.event.dom.client.ClickHandler) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) HorizontalPanel(com.google.gwt.user.client.ui.HorizontalPanel) Image(com.google.gwt.user.client.ui.Image)

Example 83 with Image

use of com.google.gwt.user.client.ui.Image in project drools-wb by kiegroup.

the class CEPOperatorsDropdown method getOperatorExtension.

// Additional widget for CEP operator parameters
private Widget getOperatorExtension() {
    container.setStylePrimaryName(GuidedRuleEditorResources.INSTANCE.css().container());
    btnAddCEPOperators = new Image(GuidedRuleEditorResources.INSTANCE.images().clock());
    btnAddCEPOperators.setVisible(parameterSets.size() > 0);
    btnAddCEPOperators.addClickHandler(new ClickHandler() {

        public void onClick(ClickEvent event) {
            visibleParameterSet++;
            if (visibleParameterSet == parameterSets.size()) {
                visibleParameterSet = 0;
            }
            hop.setParameter(VISIBLE_PARAMETER_SET, Integer.toString(visibleParameterSet));
            displayParameters();
        }
    });
    container.add(btnAddCEPOperators);
    for (int i = 0; i < this.parameters.length; i++) {
        container.add(parameters[i]);
    }
    return container;
}
Also used : ClickHandler(com.google.gwt.event.dom.client.ClickHandler) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) Image(com.google.gwt.user.client.ui.Image)

Example 84 with Image

use of com.google.gwt.user.client.ui.Image in project drools-wb by kiegroup.

the class ConstraintValueEditor method returnValueEditor.

/**
 * An editor for the retval "formula" (expression).
 */
private Widget returnValueEditor() {
    TextBox box = new BoundTextBox(constraint);
    if (this.readOnly) {
        return new SmallLabel(box.getText());
    }
    String msg = GuidedRuleEditorResources.CONSTANTS.FormulaEvaluateToAValue();
    Image img = new Image(GuidedRuleEditorResources.INSTANCE.images().functionAssets());
    img.setTitle(msg);
    box.setTitle(msg);
    box.addValueChangeHandler(new ValueChangeHandler<String>() {

        public void onValueChange(final ValueChangeEvent event) {
            executeOnValueChangeCommand();
        }
    });
    Widget ed = widgets(img, box);
    return ed;
}
Also used : SmallLabel(org.uberfire.ext.widgets.common.client.common.SmallLabel) ValueChangeEvent(com.google.gwt.event.logical.shared.ValueChangeEvent) IsWidget(com.google.gwt.user.client.ui.IsWidget) Widget(com.google.gwt.user.client.ui.Widget) TextBox(org.gwtbootstrap3.client.ui.TextBox) Image(com.google.gwt.user.client.ui.Image)

Example 85 with Image

use of com.google.gwt.user.client.ui.Image in project drools-wb by kiegroup.

the class RuleModeller method getAddAttribute.

private Widget getAddAttribute() {
    Image add = GuidedRuleEditorImages508.INSTANCE.NewItem();
    add.setTitle(GuidedRuleEditorResources.CONSTANTS.AddAnOptionToTheRuleToModifyItsBehaviorWhenEvaluatedOrExecuted());
    add.addClickHandler(new ClickHandler() {

        public void onClick(ClickEvent event) {
            showAttributeSelector();
        }
    });
    return add;
}
Also used : ClickHandler(com.google.gwt.event.dom.client.ClickHandler) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) Image(com.google.gwt.user.client.ui.Image)

Aggregations

Image (com.google.gwt.user.client.ui.Image)98 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)28 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)28 HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)15 Test (org.junit.Test)13 FlexTable (com.google.gwt.user.client.ui.FlexTable)12 HTML (com.google.gwt.user.client.ui.HTML)10 Element (com.google.gwt.dom.client.Element)8 Label (com.google.gwt.user.client.ui.Label)8 ImageResource2x (org.rstudio.core.client.resources.ImageResource2x)7 SmallLabel (org.uberfire.ext.widgets.common.client.common.SmallLabel)7 ImageResource (com.google.gwt.resources.client.ImageResource)6 Widget (com.google.gwt.user.client.ui.Widget)6 FlowPanel (com.google.gwt.user.client.ui.FlowPanel)5 Style (com.google.gwt.dom.client.Style)4 Anchor (com.google.gwt.user.client.ui.Anchor)4 VerticalPanel (com.google.gwt.user.client.ui.VerticalPanel)4 ChangeEvent (com.google.gwt.event.dom.client.ChangeEvent)3 ChangeHandler (com.google.gwt.event.dom.client.ChangeHandler)3 ValueChangeEvent (com.google.gwt.event.logical.shared.ValueChangeEvent)3