Search in sources :

Example 1 with TableElement

use of elemental.html.TableElement in project che by eclipse.

the class FindActionViewImpl method showActions.

@Override
public void showActions(Map<Action, String> actions) {
    this.actions = actions;
    actionsContainer.getElement().setInnerHTML("");
    TableElement itemHolder = Elements.createTableElement();
    itemHolder.setClassName(css.items());
    actionsContainer.getElement().appendChild(((com.google.gwt.dom.client.Element) itemHolder));
    list = SimpleList.create((SimpleList.View) actionsContainer.getElement().cast(), (Element) actionsContainer.getElement(), itemHolder, resources.defaultSimpleListCss(), listItemRenderer, eventDelegate);
    list.render(new ArrayList<>(actions.keySet()));
    if (!actions.isEmpty()) {
        list.getSelectionModel().setSelectedItem(0);
    }
    layoutPanel.setWidgetHidden(actionsPanel, false);
    layoutPanel.setHeight("250px");
    if (isVisible()) {
        Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {

            @Override
            public void execute() {
                center();
            }
        });
    }
}
Also used : Scheduler(com.google.gwt.core.client.Scheduler) Element(elemental.dom.Element) TableCellElement(elemental.html.TableCellElement) TableElement(elemental.html.TableElement) TableElement(elemental.html.TableElement)

Example 2 with TableElement

use of elemental.html.TableElement in project che by eclipse.

the class Elements method createTableElement.

public static TableElement createTableElement(String... classNames) {
    TableElement elem = getDocument().createTableElement();
    addClassesToElement(elem, classNames);
    return elem;
}
Also used : TableElement(elemental.html.TableElement)

Example 3 with TableElement

use of elemental.html.TableElement in project che by eclipse.

the class NavigateToFileViewImpl method showItems.

@Override
public void showItems(List<ItemReference> items) {
    // Hide popup if it is nothing to show
    if (items.isEmpty()) {
        suggestionsContainer.getElement().setInnerHTML("");
        suggestionsPanel.setVisible(false);
        suggestionsPanel.getElement().getStyle().setWidth(400, Style.Unit.PX);
        suggestionsPanel.getElement().getStyle().setHeight(20, Style.Unit.PX);
        return;
    }
    // Show popup
    suggestionsPanel.setVisible(true);
    suggestionsContainer.getElement().setInnerHTML("");
    // Create and show list of items
    final TableElement itemHolder = Elements.createTableElement();
    suggestionsContainer.getElement().appendChild(((com.google.gwt.dom.client.Element) itemHolder));
    list = SimpleList.create((SimpleList.View) suggestionsContainer.getElement().cast(), (Element) suggestionsContainer.getElement(), itemHolder, resources.defaultSimpleListCss(), listItemRenderer, eventDelegate);
    list.render(items);
    list.getSelectionModel().setSelectedItem(0);
    // Update popup position
    updatePositionAndSize();
}
Also used : Element(elemental.dom.Element) TableCellElement(elemental.html.TableCellElement) TableElement(elemental.html.TableElement) TableElement(elemental.html.TableElement)

Aggregations

TableElement (elemental.html.TableElement)3 Element (elemental.dom.Element)2 TableCellElement (elemental.html.TableCellElement)2 Scheduler (com.google.gwt.core.client.Scheduler)1