use of com.google.gwt.dom.client.Element in project che by eclipse.
the class MainMenuViewImpl method add.
/**
* Create and add new item in menu.
*/
private void add(Action action, PresentationFactory presentationFactory) {
Presentation presentation = presentationFactory.getPresentation(action);
if (action instanceof ActionGroup) {
ActionGroup group = (ActionGroup) action;
table.setText(0, menuBarItems.size(), presentation.getText());
Element element = table.getCellFormatter().getElement(0, menuBarItems.size());
MenuBarItem item = new MenuBarItem(group, actionManager, managerProvider, presentationFactory, element, this, keyBindingAgent, resources.menuCss());
item.onMouseOut();
menuBarItems.put(element, item);
action2barItem.put(group, item);
} else if (action instanceof CustomComponentAction) {
Widget widget = ((CustomComponentAction) action).createCustomComponent(presentation);
table.setWidget(0, menuBarItems.size(), widget);
Element element = table.getCellFormatter().getElement(0, menuBarItems.size());
menuBarItems.put(element, null);
}
}
use of com.google.gwt.dom.client.Element in project che by eclipse.
the class DefaultGoInto method reset.
/** {@inheritDoc} */
public void reset() {
//reset selection
tree.getSelectionModel().deselectAll();
Element rootContainer = tree.getContainer(null);
rootContainer.setInnerHTML("");
//restore root nodes
for (Node rootNode : rootNodes) {
NodeDescriptor descriptor = tree.getNodeDescriptor(rootNode);
rootContainer.appendChild(descriptor.getRootContainer());
}
//then re-add our go into node
Node parent = node.getParent();
if (parent != null) {
tree.getNodeStorage().add(parent, node);
}
tree.scrollIntoView(node);
tree.getSelectionModel().select(node, false);
tree.update();
active = false;
fireEvent(new GoIntoStateEvent(DEACTIVATED, node));
}
use of com.google.gwt.dom.client.Element in project che by eclipse.
the class ParametersHintsViewImpl method show.
@Override
public void show(List<MethodParameters> parametersList, int x, int y) {
parametersPanel.clear();
for (MethodParameters parameters : parametersList) {
FlowPanel widget = panelsProvider.get();
String parametersLine = parameters.getParameters();
if (parametersLine.isEmpty()) {
parametersLine = "<no parameters>";
}
String result = parametersLine.replace("<", "<").replace(">", ">");
Element element = widget.getElement();
element.setInnerHTML(result);
element.getStyle().setColor("yellow");
parametersPanel.add(widget);
}
setPopupPosition(x, y);
show();
}
use of com.google.gwt.dom.client.Element in project che by eclipse.
the class EditDebugConfigurationsViewImpl method createButtons.
private void createButtons() {
saveButton = createButton(coreLocale.save(), "window-edit-debug-configurations-save", new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
delegate.onSaveClicked();
}
});
saveButton.addStyleName(Window.resources.windowCss().primaryButton());
overFooter.add(saveButton);
cancelButton = createButton(coreLocale.cancel(), "window-edit-debug-configurations-cancel", new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
delegate.onCancelClicked();
}
});
overFooter.add(cancelButton);
debugButton = createButton(coreLocale.debug(), "window-edit-debug-configurations-debug", new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
delegate.onDebugClicked();
}
});
overFooter.add(debugButton);
closeButton = createButton(coreLocale.close(), "window-edit-debug-configurations-close", new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
delegate.onCloseClicked();
}
});
closeButton.addDomHandler(new BlurHandler() {
@Override
public void onBlur(BlurEvent blurEvent) {
//set default focus
selectText(filterInputField.getElement());
}
}, BlurEvent.getType());
addButtonToFooter(closeButton);
Element dummyFocusElement = DOM.createSpan();
dummyFocusElement.setTabIndex(0);
getFooter().getElement().appendChild(dummyFocusElement);
}
use of com.google.gwt.dom.client.Element in project actor-platform by actorapp.
the class JsFacade method handleLinkClick.
@UsedByApp
public void handleLinkClick(Event event) {
Element target = Element.as(event.getEventTarget());
String href = target.getAttribute("href");
if (href.startsWith("send:")) {
String msg = href.substring("send:".length());
msg = URL.decode(msg);
if (lastVisiblePeer != null) {
messenger.sendMessage(lastVisiblePeer, msg);
event.preventDefault();
}
} else {
if (JsElectronApp.isElectron()) {
JsElectronApp.openUrlExternal(href);
event.preventDefault();
}
}
}
Aggregations