private void renderEditorArrows() { Iterator<AbstractLazyStackPanelHeader> iterator = factModelsPanel.getHeaderIterator(); while (iterator.hasNext()) { AbstractLazyStackPanelHeader widget = (AbstractLazyStackPanelHeader) iterator.next(); if (widget instanceof FactModelEditor) { FactModelEditor editor = (FactModelEditor) widget; int index = factModels.indexOf(editor.getFactModel()); editor.setUpVisible(index != 0); editor.setDownVisible(index != (factModels.size() - 1)); } } }
public void addFactModelToStackPanel(final FactMetaModel factMetaModel) { final FactModelEditor editor = new FactModelEditor(factMetaModel, superTypeFactModels, modelNameHelper); editor.setMoveDownCommand(getMoveDownCommand(factMetaModel)); editor.setMoveUpCommand(getMoveUpCommand(factMetaModel)); editor.setDeleteEvent(getDeleteCommand(factMetaModel)); factModelsPanel.add( editor, new LoadContentCommand() { public Widget load() { return editor.getContent(); } }); renderEditorArrows(); }
private void swap(int editingFactIndex, int newIndex) { Collections.swap(factModels, editingFactIndex, newIndex); factModelsPanel.swap(editingFactIndex, newIndex); }