use of com.google.gwt.dom.client.SpanElement in project che by eclipse.
the class EditDebugConfigurationsViewImpl method renderCategoryHeader.
private SpanElement renderCategoryHeader(final String categoryTitle) {
SpanElement categoryHeaderElement = Document.get().createSpanElement();
categoryHeaderElement.setClassName(editConfigurationsResources.getCss().categoryHeader());
SpanElement iconElement = Document.get().createSpanElement();
categoryHeaderElement.appendChild(iconElement);
SpanElement textElement = Document.get().createSpanElement();
categoryHeaderElement.appendChild(textElement);
DebugConfigurationType currentDebugConfigurationType = getTypeById(categoryTitle);
textElement.setInnerText(currentDebugConfigurationType != null ? currentDebugConfigurationType.getDisplayName() : categoryTitle);
SpanElement buttonElement = Document.get().createSpanElement();
buttonElement.appendChild(editConfigurationsResources.addConfigurationButton().getSvg().getElement());
categoryHeaderElement.appendChild(buttonElement);
Event.sinkEvents(buttonElement, Event.ONCLICK);
Event.setEventListener(buttonElement, new EventListener() {
@Override
public void onBrowserEvent(Event event) {
if (Event.ONCLICK == event.getTypeInt()) {
event.stopPropagation();
namePanel.setVisible(true);
selectedType = getTypeById(categoryTitle);
delegate.onAddClicked();
resetFilter();
}
}
});
Icon icon = iconRegistry.getIconIfExist(categoryTitle + ".debug.configuration.type.icon");
if (icon != null) {
final SVGImage iconSVG = icon.getSVGImage();
if (iconSVG != null) {
iconElement.appendChild(iconSVG.getElement());
return categoryHeaderElement;
}
}
return categoryHeaderElement;
}
use of com.google.gwt.dom.client.SpanElement in project che by eclipse.
the class EditDebugConfigurationsViewImpl method renderSubElementButtons.
private SpanElement renderSubElementButtons() {
final SpanElement categorySubElement = Document.get().createSpanElement();
categorySubElement.setClassName(editConfigurationsResources.getCss().buttonArea());
final SpanElement removeConfigurationButtonElement = Document.get().createSpanElement();
categorySubElement.appendChild(removeConfigurationButtonElement);
removeConfigurationButtonElement.appendChild(this.editConfigurationsResources.removeConfigurationButton().getSvg().getElement());
Event.sinkEvents(removeConfigurationButtonElement, Event.ONCLICK);
Event.setEventListener(removeConfigurationButtonElement, new EventListener() {
@Override
public void onBrowserEvent(Event event) {
if (Event.ONCLICK == event.getTypeInt()) {
event.stopPropagation();
setSelectedConfiguration(selectedConfiguration);
delegate.onRemoveClicked(selectedConfiguration);
}
}
});
final SpanElement duplicateConfigurationButton = Document.get().createSpanElement();
categorySubElement.appendChild(duplicateConfigurationButton);
duplicateConfigurationButton.appendChild(this.editConfigurationsResources.duplicateConfigurationButton().getSvg().getElement());
Event.sinkEvents(duplicateConfigurationButton, Event.ONCLICK);
Event.setEventListener(duplicateConfigurationButton, new EventListener() {
@Override
public void onBrowserEvent(Event event) {
if (Event.ONCLICK == event.getTypeInt()) {
event.stopPropagation();
delegate.onDuplicateClicked();
}
}
});
return categorySubElement;
}
use of com.google.gwt.dom.client.SpanElement in project che by eclipse.
the class TargetsViewImpl method createMachineLabel.
private SpanElement createMachineLabel(String machineCategory) {
final SpanElement machineLabel = Document.get().createSpanElement();
Icon icon = iconRegistry.getIconIfExist(machineCategory + ".machine.icon");
if (icon != null) {
machineLabel.appendChild(icon.getSVGImage().getElement());
return machineLabel;
}
if (LABELS.containsKey(machineCategory)) {
machineLabel.setInnerText(LABELS.get(machineCategory));
machineLabel.setClassName(this.machineResources.getCss().dockerMachineLabel());
return machineLabel;
}
machineLabel.setInnerText(machineCategory.substring(0, 3));
machineLabel.setClassName(this.machineResources.getCss().differentMachineLabel());
return machineLabel;
}
use of com.google.gwt.dom.client.SpanElement in project che by eclipse.
the class EditCommandsViewImpl method createCommandButtons.
/** Creates and returns buttons for duplicating and removing command. */
private SpanElement createCommandButtons() {
final SpanElement removeCommandButton = Document.get().createSpanElement();
removeCommandButton.appendChild(commandResources.removeCommandButton().getSvg().getElement());
Event.sinkEvents(removeCommandButton, Event.ONCLICK);
Event.setEventListener(removeCommandButton, new EventListener() {
@Override
public void onBrowserEvent(Event event) {
if (Event.ONCLICK == event.getTypeInt()) {
event.stopPropagation();
onCommandSelected(selectedCommand);
delegate.onRemoveClicked();
}
}
});
final SpanElement duplicateCommandButton = Document.get().createSpanElement();
duplicateCommandButton.appendChild(commandResources.duplicateCommandButton().getSvg().getElement());
Event.sinkEvents(duplicateCommandButton, Event.ONCLICK);
Event.setEventListener(duplicateCommandButton, new EventListener() {
@Override
public void onBrowserEvent(Event event) {
if (Event.ONCLICK == event.getTypeInt()) {
event.stopPropagation();
delegate.onDuplicateClicked();
}
}
});
final SpanElement buttonsPanel = Document.get().createSpanElement();
buttonsPanel.setClassName(commandResources.getCss().buttonArea());
buttonsPanel.appendChild(removeCommandButton);
buttonsPanel.appendChild(duplicateCommandButton);
return buttonsPanel;
}
use of com.google.gwt.dom.client.SpanElement in project che by eclipse.
the class EditCommandsViewImpl method createCategoryHeaderForCommandType.
private SpanElement createCategoryHeaderForCommandType(final String commandTypeId) {
final SpanElement categoryHeaderElement = Document.get().createSpanElement();
categoryHeaderElement.setClassName(commandResources.getCss().categoryHeader());
final SpanElement iconElement = Document.get().createSpanElement();
categoryHeaderElement.appendChild(iconElement);
final SpanElement nameElement = Document.get().createSpanElement();
categoryHeaderElement.appendChild(nameElement);
final CommandType currentCommandType = getTypeById(commandTypeId);
nameElement.setInnerText(currentCommandType != null ? currentCommandType.getDisplayName() : commandTypeId);
final SpanElement buttonElement = Document.get().createSpanElement();
buttonElement.appendChild(commandResources.addCommandButton().getSvg().getElement());
categoryHeaderElement.appendChild(buttonElement);
Event.sinkEvents(buttonElement, Event.ONCLICK);
Event.setEventListener(buttonElement, new EventListener() {
@Override
public void onBrowserEvent(Event event) {
if (Event.ONCLICK == event.getTypeInt()) {
event.stopPropagation();
namePanel.setVisible(true);
previewUrlPanel.setVisible(true);
selectedType = commandTypeId;
delegate.onAddClicked();
resetFilter();
}
}
});
final Icon icon = iconRegistry.getIconIfExist(commandTypeId + ".commands.category.icon");
if (icon != null) {
final SVGImage iconSVG = icon.getSVGImage();
if (iconSVG != null) {
iconElement.appendChild(iconSVG.getElement());
return categoryHeaderElement;
}
}
return categoryHeaderElement;
}
Aggregations