@SuppressWarnings("unchecked") @Override public <SELECTIONTYPE> UISelection<SELECTIONTYPE> getInitialSelection() { return (UISelection<SELECTIONTYPE>) Selections.from(selection); }
@SuppressWarnings({ "unchecked", "rawtypes" }) public static <SELECTIONTYPE> UISelection<SELECTIONTYPE> from(Function<SELECTIONTYPE, UIRegion> regions, Iterable<SELECTIONTYPE> type) { if (type == null || Lists.toList(type).isEmpty()) { return emptySelection(); } else { return new SelectionImpl(regions, type); } }
@SuppressWarnings({ "unchecked", "rawtypes" }) public static <SELECTIONTYPE> UISelection<SELECTIONTYPE> from(SELECTIONTYPE... type) { if (type == null || type.length == 0 || type[0] == null) { return emptySelection(); } else { if (type.length == 1 && type[0] instanceof Iterable) { return new SelectionImpl((Iterable<SELECTIONTYPE>) type[0]); } else { return new SelectionImpl(type); } } }
@SuppressWarnings("unchecked") @Override public <SELECTIONTYPE> UISelection<SELECTIONTYPE> getInitialSelection() { return (UISelection<SELECTIONTYPE>) Selections.from(selection); }
@SuppressWarnings("unchecked") @Override public <SELECTIONTYPE> UISelection<SELECTIONTYPE> getInitialSelection() { return (UISelection<SELECTIONTYPE>) Selections.from(selection); }
public static <SELECTIONTYPE> UISelection<SELECTIONTYPE> from(Iterable<SELECTIONTYPE> type) { return from(null, type); }
@SuppressWarnings("unchecked") @Override public <SELECTIONTYPE> void setSelection(SELECTIONTYPE selection) { if (selection == null) { this.selection = null; } else if (selection instanceof UISelection) { this.selection = (UISelection<?>) selection; } else { this.selection = Selections.from(selection); } }
public ShellContextImpl createUIContext() { Imported<UIContextListener> listeners = addonRegistry.getServices(UIContextListener.class); UISelection<?> initialSelection = Selections.from(currentResource); ShellContextImpl shellContextImpl = new ShellContextImpl(this, initialSelection, listeners); for (CommandExecutionListener listener : executionListeners) { shellContextImpl.addCommandExecutionListener(listener); } ExportManager exportManager = null; if (console != null) exportManager = console.getExportManager(); if (exportManager != null) { Map<Object, Object> attributeMap = shellContextImpl.getAttributeMap(); for (String variableName : exportManager.getAllNames()) { String variableValue = exportManager.getValue(variableName); attributeMap.put(variableName, variableValue); } } return shellContextImpl; }