@Override protected void onPrepareResults(OrienteerDataTable<ODocument, String> table, OClass oClass, IModel<DisplayMode> modeModel) { table.addCommand(createSelectCommand(table)); if (isMultiValue) { table.addCommand(createSelectAndSearchCommand(table, this)); } }
public OrienteerDataTable(String id, List<? extends IColumn<T, S>> columns, ISortableDataProvider<T, S> dataProvider, int rowsPerPage) { super(id, columns, dataProvider, rowsPerPage); addTopToolbar(commandsToolbar= new DataTableCommandsToolbar<T>(this)); addTopToolbar(headersToolbar = new OrienteerHeadersToolbar<>(this, dataProvider)); addBottomToolbar(navigationToolbar = new OrienteerNavigationToolbar(this)); addBottomToolbar(noRecordsToolbar = new NoRecordsToolbar(this)); setOutputMarkupPlaceholderTag(true); setItemReuseStrategy(ReuseIfModelsEqualStrategy.getInstance()); add(UpdateOnActionPerformedEventBehavior.INSTANCE_ALL_CONTINUE); }
public OrienteerDataTable<T, S> setCaptionModel(IModel<String> captionModel) { get("caption").setDefaultModel(captionModel); this.captionModel = captionModel; return this; }
protected AbstractIndexesWidget(String id, IModel<T> model, IModel<ODocument> widgetDocumentModel) { super(id, model, widgetDocumentModel); IModel<DisplayMode> indexesDisplayMode = getModeModel(); List<IColumn<OIndex<?>, String>> iColumns = new ArrayList<IColumn<OIndex<?>,String>>(); iColumns.add(new CheckBoxColumn<OIndex<?>, String, String>(OIndexNameConverter.INSTANCE)); iColumns.add(new OIndexDefinitionColumn(OIndexPrototyper.NAME, indexesDisplayMode)); iColumns.add(new OIndexMetaColumn(OIndexPrototyper.TYPE, indexesDisplayMode)); iColumns.add(new OIndexMetaColumn(OIndexPrototyper.DEF_FIELDS, indexesDisplayMode)); iColumns.add(new OIndexMetaColumn(OIndexPrototyper.DEF_COLLATE, indexesDisplayMode)); iColumns.add(new OIndexMetaColumn(OIndexPrototyper.DEF_NULLS_IGNORED, indexesDisplayMode)); iColumns.add(new OIndexMetaColumn(OIndexPrototyper.SIZE, indexesDisplayMode)); iColumns.add(new OIndexMetaColumn(OIndexPrototyper.KEY_SIZE, indexesDisplayMode)); OIndexesDataProvider iProvider = getIndexDataProvider(); iProvider.setSort("name", SortOrder.ASCENDING); GenericTablePanel<OIndex<?>> tablePanel = new GenericTablePanel<OIndex<?>>("tablePanel", iColumns, iProvider ,20); iTable = tablePanel.getDataTable(); iTable.addCommand(new EditSchemaCommand<OIndex<?>>(iTable, indexesDisplayMode)); iTable.addCommand(new SaveSchemaCommand<OIndex<?>>(iTable, indexesDisplayMode)); iTable.addCommand(new DeleteOIndexCommand(iTable)); iTable.setCaptionModel(new ResourceModel("class.indexes")); add(tablePanel); add(DisableIfPrototypeBehavior.INSTANCE, UpdateOnActionPerformedEventBehavior.INSTANCE_ALL_CONTINUE); }
public OrienteerCloudOModulesConfigurationsPanel(String id, final OArtifactsModalWindowPage windowPage, ISortableDataProvider<OArtifact, String> provider) { super(id); setOutputMarkupPlaceholderTag(true); Form orienteerModulesForm = new Form("orienteerCloudOModulesConfigsForm"); Label feedback = new Label("feedback"); feedback.setVisible(false); feedback.setOutputMarkupPlaceholderTag(true); IModel<DisplayMode> modeModel = DisplayMode.VIEW.asModel(); List<IColumn<OArtifact, String>> columns = getColumns(modeModel); OrienteerDataTable<OArtifact, String> table = new OrienteerDataTable<>("availableModules", columns, provider, 10); table.addCommand(new AjaxCommand<OArtifact>(new ResourceModel(BACK_BUT), table) { @Override public void onClick(Optional<AjaxRequestTarget> targetOptional) { windowPage.showOrienteerModulesPanel(false); targetOptional.ifPresent(target->target.add(windowPage)); } @Override protected void onInstantiation() { super.onInstantiation(); setIcon(FAIconType.angle_left); setBootstrapType(BootstrapType.PRIMARY); setAutoNotify(false); } }); table.addCommand(new InstallOModuleCommand(table, windowPage, false, feedback)); table.addCommand(new InstallOModuleCommand(table, windowPage,true, feedback)); orienteerModulesForm.add(table); orienteerModulesForm.add(feedback); add(orienteerModulesForm); }
GenericTablePanel<ODocument> tablePanel = new GenericTablePanel<>("links", columns, provider, 10); OrienteerDataTable<ODocument, String> table = tablePanel.getDataTable(); table.getHeadersToolbar().setVisibilityAllowed(false); table.getNoRecordsToolbar().setVisibilityAllowed(false); table.addCommand(new SelectODocumentCommand(table, documentModel, new OPropertyModel(property)) .setBootstrapSize(BootstrapSize.EXTRA_SMALL) .setIcon((String)null));
public ListAllODocumentsWidget(String id, IModel<OClass> model, IModel<ODocument> widgetDocumentModel) { super(id, model, widgetDocumentModel); IModel<DisplayMode> modeModel = DisplayMode.VIEW.asModel(); String className = getModelObject().getName(); String sql = "select from " + className; OQueryDataProvider<ODocument> provider = new OQueryDataProvider<>(sql); oClassIntrospector.defineDefaultSorting(provider, getModelObject()); GenericTablePanel<ODocument> tablePanel = new GenericTablePanel<>("tablePanel", oClassIntrospector.getColumnsFor(getModelObject(), true, modeModel), provider, 20); final OrienteerDataTable<ODocument, String> table = tablePanel.getDataTable(); table.getCommandsToolbar().setDefaultModel(getModel()); table.addCommand(new CreateODocumentCommand(table, getModel())); table.addCommand(new EditODocumentsCommand(table, modeModel, getModel())); table.addCommand(new SaveODocumentsCommand(table, modeModel)); table.addCommand(new CopyODocumentCommand(table, getModel())); table.addCommand(new DeleteODocumentCommand(table, getModel())); table.addCommand(new ExportCommand<>(table, new PropertyModel<String>(model, "name"))); add(tablePanel); add(UpdateOnActionPerformedEventBehavior.INSTANCE_ALL_CONTINUE); addCommand(new BookmarkablePageLinkCommand<OClass>(newCommandId(), "command.gotoClass", OClassPage.class) { @Override public PageParameters getPageParameters() { return OClassPage.preparePageParameters(ListAllODocumentsWidget.this.getModelObject(), DisplayMode.VIEW); } }); }
tablePanel.add(new SecurityBehavior(model, Component.ENABLE, OrientPermission.UPDATE)); OrienteerDataTable<String, String> sTable = tablePanel.getDataTable(); sTable.addCommand(new AbstractSaveCommand<String>(sTable, null)); sTable.addCommand(new AbstractModalWindowCommand<String>(sTable.newCommandId(), "command.add") { sTable.addCommand(new AbstractDeleteCommand<String>(sTable) {
Args.notNull(provider, "provider"); setOutputMarkupPlaceholderTag(true); dataTable = new OrienteerDataTable<>("table", columns, provider, rowsPerRange); if (filtered) { final FilterForm<OQueryModel<K>> filterForm = new FilterForm<OQueryModel<K>>("form", dataTable.addFilterForm(filterForm); filterForm.add(dataTable); AjaxFallbackButton button = new AjaxFallbackButton("submit", filterForm) {};
GenericTablePanel<OProperty> tablePanel = new GenericTablePanel<OProperty>("tablePanel", pColumns, pProvider ,20); OrienteerDataTable<OProperty, String> pTable = tablePanel.getDataTable(); pTable.addCommand(new CreateOPropertyCommand(pTable, getModel())); pTable.addCommand(new EditSchemaCommand<OProperty>(pTable, propertiesDisplayMode)); pTable.addCommand(new SaveSchemaCommand<OProperty>(pTable, propertiesDisplayMode)); pTable.addCommand(new ShowHideParentsCommand<OProperty>(getModel(), pTable, showParentPropertiesModel)); pTable.addCommand(new DeleteOPropertyCommand(pTable)); pTable.addCommand(new CreateOIndexFromOPropertiesCommand(pTable, getModel())); pTable.setCaptionModel(new ResourceModel("class.properties")); add(tablePanel); add(DisableIfPrototypeBehavior.INSTANCE, UpdateOnActionPerformedEventBehavior.INSTANCE_ALL_CONTINUE);
ISortableDataProvider<OArtifact, String> availableModulesProvider = new JavaSortableDataProvider<>(availableModulesModel); final OrienteerDataTable<OArtifact, String> modulesTable = new OrienteerDataTable<>("oArtifactsTable", columns, installedModulesProvider, 20); modulesTable.addCommand(new AddOArtifactCommand(modulesTable, new OArtifactsModalWindowPage(availableModulesProvider))); modulesTable.addCommand(new EditOArtifactsCommand(modulesTable, modeModel)); modulesTable.addCommand(new SaveOArtifactCommand(modulesTable, modeModel, feedback)); modulesTable.addCommand(new DeleteOArtifactCommand(modulesTable)); modulesTable.addCommand(new ReloadOrienteerCommand(modulesTable, new ResourceModel(RELOAD_ORIENTEER))); form.add(modulesTable); form.add(feedback);
@Override protected void onPrepareResults(OrienteerDataTable<ODocument, String> table, OClass oClass, IModel<DisplayMode> modeModel) { table.addCommand(new EditODocumentsCommand(table, modeModel, oClass)); table.addCommand(new SaveODocumentsCommand(table, modeModel)); } });
OrienteerDataTable<ODocument, String> table = tablePanel.getDataTable(); final OPropertyNamingModel propertyNamingModel = new OPropertyNamingModel(propertyModel); table.setCaptionModel(propertyNamingModel); SecurityBehavior securityBehaviour = new SecurityBehavior(documentModel, OrientPermission.UPDATE); if(!isStructureReadonly) table.addCommand(new CreateODocumentCommand(table, documentModel, propertyModel).add(securityBehaviour)); table.addCommand(new EditODocumentsCommand(table, modeModel, linkedClass).add(securityBehaviour)); table.addCommand(new SaveODocumentsCommand(table, modeModel).add(securityBehaviour)); table.addCommand(new CopyODocumentCommand(table, linkedClass).add(securityBehaviour)); table.addCommand(new DeleteODocumentCommand(table, linkedClass).add(securityBehaviour)); table.addCommand(new SelectODocumentCommand(table, documentModel, propertyModel).add(securityBehaviour)); table.addCommand(new ReleaseODocumentCommand(table, documentModel, propertyModel).add(securityBehaviour)); table.addCommand(new EditODocumentsCommand(table, modeModel, linkedClass).add(securityBehaviour)); table.addCommand(new SaveODocumentsCommand(table, modeModel).add(securityBehaviour)); table.addCommand(new ExportCommand<>(table, new LoadableDetachableModel<String>() { @Override protected String load() {
@Override protected void addTableCommands(OrienteerDataTable<OClass, String> table, IModel<DisplayMode> modeModel) { table.addCommand(new CreateOClassCommand(table)); table.addCommand(new EditSchemaCommand<>(table, modeModel)); table.addCommand(new SaveSchemaCommand<>(table, modeModel)); table.addCommand(new DeleteOClassCommand(table)); table.addCommand(new ReloadOMetadataCommand(table)); table.addCommand(new TriggerCommand<>("command.showhide.allclasses", table, showAllClassesModel)); table.addCommand(new ExportOSchemaCommand(table)); table.addCommand(new ImportOSchemaCommand(table)); table.addCommand(new ViewUMLCommand(table)); }
public OClusterSecurityWidget(String id, IModel<OCluster> model, IModel<ODocument> widgetDocumentModel) { super(id, model, widgetDocumentModel); List<IColumn<ORole, String>> sColumns = new ArrayList<IColumn<ORole,String>>(); OClass oRoleClass = OrientDbWebSession.get().getDatabase().getMetadata().getSchema().getClass("ORole"); sColumns.add(new AbstractColumn<ORole, String>(new OClassNamingModel(oRoleClass), "name") { @Override public void populateItem(Item<ICellPopulator<ORole>> cellItem, String componentId, IModel<ORole> rowModel) { cellItem.add(new LinkViewPanel(componentId, new PropertyModel<ODocument>(rowModel, "document"))); } }); sColumns.add(new SecurityRightsColumn(OrientPermission.CREATE)); sColumns.add(new SecurityRightsColumn(OrientPermission.READ)); sColumns.add(new SecurityRightsColumn(OrientPermission.UPDATE)); sColumns.add(new SecurityRightsColumn(OrientPermission.DELETE)); OQueryDataProvider<ORole> sProvider = new OQueryDataProvider<ORole>("select from ORole", ORole.class); sProvider.setSort("name", SortOrder.ASCENDING); GenericTablePanel<ORole> tablePanel = new GenericTablePanel<ORole>("tablePanel", sColumns, sProvider ,20); OSecurityHelper.secureComponent(tablePanel, OSecurityHelper.requireOClass("ORole", Component.ENABLE, OrientPermission.UPDATE)); OrienteerDataTable<ORole, String> sTable = tablePanel.getDataTable(); Command<ORole> saveCommand = new AbstractSaveCommand<ORole>(sTable, null); sTable.addCommand(saveCommand); sTable.setCaptionModel(new ResourceModel("cluster.security")); add(tablePanel); add(DisableIfPrototypeBehavior.INSTANCE, UpdateOnActionPerformedEventBehavior.INSTANCE_ALL_CONTINUE); }
private void addCommands(OrienteerDataTable<OClass, String> table) { table.addCommand(createAddClassesCommand(table)); table.addCommand(createCancelCommand(table)); }
public OClassSecurityWidget(String id, IModel<OClass> model, IModel<ODocument> widgetDocumentModel) { super(id, model, widgetDocumentModel); List<IColumn<ORole, String>> sColumns = new ArrayList<IColumn<ORole,String>>(); OClass oRoleClass = OrientDbWebSession.get().getDatabase().getMetadata().getSchema().getClass("ORole"); sColumns.add(new AbstractColumn<ORole, String>(new OClassNamingModel(oRoleClass), "name") { @Override public void populateItem(Item<ICellPopulator<ORole>> cellItem, String componentId, IModel<ORole> rowModel) { cellItem.add(new LinkViewPanel(componentId, new PropertyModel<ODocument>(rowModel, "document"))); } }); sColumns.add(new SecurityRightsColumn(OrientPermission.EXECUTE)); sColumns.add(new SecurityRightsColumn(OrientPermission.CREATE)); sColumns.add(new SecurityRightsColumn(OrientPermission.READ)); sColumns.add(new SecurityRightsColumn(OrientPermission.UPDATE)); sColumns.add(new SecurityRightsColumn(OrientPermission.DELETE)); OQueryDataProvider<ORole> sProvider = new OQueryDataProvider<ORole>("select from ORole", ORole.class); sProvider.setSort("name", SortOrder.ASCENDING); GenericTablePanel<ORole> tablePanel = new GenericTablePanel<ORole>("tablePanel", sColumns, sProvider ,20); OSecurityHelper.secureComponent(tablePanel, OSecurityHelper.requireOClass("ORole", Component.ENABLE, OrientPermission.UPDATE)); OrienteerDataTable<ORole, String> sTable = tablePanel.getDataTable(); Command<ORole> saveCommand = new AbstractSaveCommand<ORole>(sTable, null); sTable.addCommand(saveCommand); sTable.setCaptionModel(new ResourceModel("class.security")); add(tablePanel); add(DisableIfPrototypeBehavior.INSTANCE, UpdateOnActionPerformedEventBehavior.INSTANCE_ALL_CONTINUE); }
private void addTableCommands(OrienteerDataTable<OCluster, String> table, IModel<DisplayMode> modeModel) { table.addCommand(new EditSchemaCommand<OCluster>(table, modeModel)); table.addCommand(new SaveSchemaCommand<OCluster>(table, modeModel)); }
table = tablePanel.getDataTable(); table.addCommand(new EditODocumentsCommand(table, getModeModel(), new OClassModel(OrienteerLocalizationModule.OCLASS_LOCALIZATION))); table.addCommand(new SaveOLocalizationsCommand(table, getModeModel())); table.setCaptionModel(new ResourceModel("class.localization")); table.addCommand(ajaxFormCommand.setBootstrapType(BootstrapType.PRIMARY) .setIcon(FAIconType.language)); add(tablePanel);
@Override protected void addTableCommands(OrienteerDataTable<OClass, String> table, IModel<DisplayMode> modeModel) { table.addCommand(new CreateOClassCommand(table, getModel())); table.addCommand(new EditSchemaCommand<OClass>(table, modeModel)); table.addCommand(new SaveSchemaCommand<OClass>(table, modeModel)); table.addCommand(new DeleteOClassCommand(table)); }