org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn Java Examples

The following examples show how to use org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: InfinitePagingDataTable.java    From sakai with Educational Community License v2.0 6 votes vote down vote up
@Override
protected Item newCellItem(final String id, final int index, final IModel model)
{
	Item item = InfinitePagingDataTable.this.newCellItem(id, index, model);
	final IColumn<T, S> column = InfinitePagingDataTable.this.columns.get(index);
	if (column instanceof IStyledColumn)
	{
		item.add(new CssAttributeBehavior()
		{
			private static final long serialVersionUID = 1L;

			@Override
			protected String getCssClass()
			{
				return ((IStyledColumn<T, S>)column).getCssClass();
			}
		});
	}

	return item;
}
 
Example #2
Source File: AbstractCheckBoxEnabledCommand.java    From Orienteer with Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("unchecked")
@Override
protected void onConfigure() {
	super.onConfigure();
	if(checkboxColumn==null)
	{
		for (IColumn<T, ?> column : table.getColumns())
		{
			if(column instanceof CheckBoxColumn)
			{
				checkboxColumn=(CheckBoxColumn<T, ?, ?>) column;
				break;
			}
		}
	}
	setVisible(checkboxColumn!=null);
}
 
Example #3
Source File: EmployeeSalaryListPage.java    From projectforge-webapp with GNU General Public License v3.0 6 votes vote down vote up
@Override
protected void init()
{
  final List<IColumn<EmployeeSalaryDO, String>> columns = createColumns(this, true);
  dataTable = createDataTable(columns, "employee.user.lastname", SortOrder.ASCENDING);
  form.add(dataTable);
  addExcelExport(getString("fibu.employee.salaries"), getString("fibu.employee.salaries"));
  {
    // Excel export
    @SuppressWarnings("serial")
    final SubmitLink excelExportLink = new SubmitLink(ContentMenuEntryPanel.LINK_ID, form) {
      @Override
      public void onSubmit()
      {
        if (form.getSearchFilter().getMonth() < 0 || form.getSearchFilter().getMonth() > 11) {
          form.addError("fibu.employee.salary.error.monthNotGiven");
          return;
        }
        exportExcel();
      }
    };
    final ContentMenuEntryPanel excelExportButton = new ContentMenuEntryPanel(getNewContentMenuChildId(), excelExportLink,
        getString("fibu.rechnung.kostExcelExport")).setTooltip(getString("fibu.employee.salary.exportXls.tooltip"));
    addContentMenuEntry(excelExportButton);
  }
}
 
Example #4
Source File: HomePage.java    From wicket-orientdb with Apache License 2.0 6 votes vote down vote up
public HomePage(final PageParameters parameters) {
		super(parameters);

		add(new DebugBar("debugBar"));
		add(new Label("dbName", new PropertyModel<String>(this, "session.database.name")));
		add(new Label("dbUrl", new PropertyModel<String>(this, "session.database.URL")));
		add(new Label("dbUserName", new PropertyModel<String>(this, "session.database.user.name")));
		add(new Label("signedIn", new PropertyModel<String>(this, "session.signedIn")));
		add(new Label("signedInUser", new PropertyModel<String>(this, "session.user.name")));
//		((OrientDbWebSession)getSession()).getDatabase().getUser().
		add(new SignInPanel("signInPanel"));
		OQueryDataProvider<ODocument> provider = new OQueryDataProvider<>("select from "+WicketApplication.CLASS_NAME);
		List<IColumn<ODocument, String>> columns = new ArrayList<>();
		columns.add(new DocumentPropertyColumn(Model.of(WicketApplication.PROP_NAME), WicketApplication.PROP_NAME, WicketApplication.PROP_NAME));
		columns.add(new DocumentPropertyColumn(Model.of(WicketApplication.PROP_INT), WicketApplication.PROP_INT, WicketApplication.PROP_INT));
		columns.add(new DocumentPropertyColumn(Model.of(WicketApplication.PROP_DATE), WicketApplication.PROP_DATE, WicketApplication.PROP_DATE));
		DefaultDataTable<ODocument, String> table = new DefaultDataTable<>("table", columns, provider, 15);
		add(table);
    }
 
Example #5
Source File: InfinitePagingDataTable.java    From sakai with Educational Community License v2.0 6 votes vote down vote up
@Override
protected Item newCellItem(final String id, final int index, final IModel model)
{
	Item item = InfinitePagingDataTable.this.newCellItem(id, index, model);
	final IColumn<T, S> column = InfinitePagingDataTable.this.columns.get(index);
	if (column instanceof IStyledColumn)
	{
		item.add(new CssAttributeBehavior()
		{
			private static final long serialVersionUID = 1L;

			@Override
			protected String getCssClass()
			{
				return ((IStyledColumn<T, S>)column).getCssClass();
			}
		});
	}

	return item;
}
 
Example #6
Source File: AbstractCalculatedDocumentsWidget.java    From Orienteer with Apache License 2.0 6 votes vote down vote up
@Override
protected void onInitialize() {
	super.onInitialize();

	IModel<DisplayMode> modeModel = DisplayMode.VIEW.asModel();
	final String sql = getSql();

	GenericTablePanel<ODocument> tablePanel;

	if (!Strings.isEmpty(sql)) {
		OQueryDataProvider<ODocument> provider = newDataProvider(sql);
		OClass expectedClass = getExpectedClass(provider);
		if (expectedClass != null) {
			oClassIntrospector.defineDefaultSorting(provider, expectedClass);
			List<? extends IColumn<ODocument, String>> columns = oClassIntrospector.getColumnsFor(expectedClass, true, modeModel);
			tablePanel = new GenericTablePanel<>("tablePanel", columns, provider, 20);
			customizeDataTable(tablePanel.getDataTable(), modeModel, new OClassModel(expectedClass));
		} else {
			tablePanel = new GenericTablePanel<>("tablePanel",  new ResourceModel("error.class.not.defined"));
		}
	} else {
		tablePanel = new GenericTablePanel<>("tablePanel",  new ResourceModel("error.query.not.defined"));
	}

	add(tablePanel);
}
 
Example #7
Source File: InfinitePagingDataTable.java    From sakai with Educational Community License v2.0 6 votes vote down vote up
public InfinitePagingDataTable(String id, final List<? extends IColumn<T, S>> columns, final InfiniteDataProvider<T> dataProvider, final long rowsPerPage)
{
	super(id);

	Args.notEmpty(columns, "columns");

	this.columns = columns;
	this.caption = new Caption("caption", getCaptionModel());
	add(caption);
	body = newBodyContainer("body");
	datagrid = newInfinitePagingDataGridView("rows", columns, dataProvider);
	datagrid.setItemsPerPage(rowsPerPage);
	body.add(datagrid);
	add(body);
	topToolbars = new ToolbarsContainer("topToolbars");
	bottomToolbars = new ToolbarsContainer("bottomToolbars");
	add(topToolbars);
	add(bottomToolbars);
}
 
Example #8
Source File: SAML2IdPsDirectoryPanel.java    From syncope with Apache License 2.0 6 votes vote down vote up
@Override
protected List<IColumn<SAML2IdPTO, String>> getColumns() {
    List<IColumn<SAML2IdPTO, String>> columns = new ArrayList<>();

    columns.add(new KeyPropertyColumn<>(new ResourceModel("key"), "key", "key"));
    columns.add(new PropertyColumn<>(new ResourceModel("name"), "name", "name"));
    columns.add(new PropertyColumn<>(new ResourceModel("entityID"), "entityID", "entityID"));
    columns.add(new BooleanPropertyColumn<>(
            new ResourceModel("useDeflateEncoding"), "useDeflateEncoding", "useDeflateEncoding"));
    columns.add(new BooleanPropertyColumn<>(
            new ResourceModel("supportUnsolicited"), "supportUnsolicited", "supportUnsolicited"));
    columns.add(new PropertyColumn<>(
            new ResourceModel("bindingType"), "bindingType", "bindingType"));
    columns.add(new BooleanPropertyColumn<>(
            new ResourceModel("logoutSupported"), "logoutSupported", "logoutSupported"));

    return columns;
}
 
Example #9
Source File: AbstractIndexesWidget.java    From Orienteer with Apache License 2.0 6 votes vote down vote up
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);
}
 
Example #10
Source File: OrienteerCloudOModulesConfigurationsPanel.java    From Orienteer with Apache License 2.0 6 votes vote down vote up
private List<IColumn<OArtifact, String>> getColumns(IModel<DisplayMode> modeModel) {
    List<IColumn<OArtifact, String>> columns = Lists.newArrayList();
    columns.add(new CheckBoxColumn<OArtifact, OArtifact, String>(new IdentityConverter<OArtifact>()) {
        @Override
        public void populateItem(Item<ICellPopulator<OArtifact>> cellItem, String componentId, final IModel<OArtifact> rowModel) {
            cellItem.add(new BooleanEditPanel(componentId, getCheckBoxModel(rowModel)) {
                @Override
                public boolean isEnabled() {
                    return rowModel.getObject() != null && !rowModel.getObject().isDownloaded();
                }
            });
        }
    });
    columns.add(new OArtifactColumn(OArtifactField.GROUP.asModel(), modeModel));
    columns.add(new OArtifactColumn(OArtifactField.ARTIFACT.asModel(), modeModel));
    columns.add(new OArtifactColumn(OArtifactField.VERSION.asModel(), DisplayMode.EDIT.asModel()));
    columns.add(new OArtifactColumn(OArtifactField.DESCRIPTION.asModel(), modeModel));
    columns.add(new OArtifactColumn(OArtifactField.DOWNLOADED.asModel(), modeModel));
    return columns;
}
 
Example #11
Source File: AnalysisTablePanel.java    From nextreports-server with Apache License 2.0 6 votes vote down vote up
private List<IColumn<AnalysisRow, String>> getPropertyColumns(List<String> header) {
List<IColumn<AnalysisRow, String>> columns = new ArrayList<IColumn<AnalysisRow, String>>();
int columnCount = header.size();		

for (int i = 0; i < columnCount; i++) {
	final int j = i;
	columns.add(new PropertyColumn<AnalysisRow, String>(new Model<String>(header.get(i)), header.get(i), "cellValues." + i) {
		public void populateItem(Item cellItem, String componentId, IModel rowModel) {
			setCellStyle(cellItem, rowModel, j);
			super.populateItem(cellItem, componentId, rowModel);
		}
	});
}		
// critical case when someone deleted the database folder
if (columns.size() == 0) {
	columns.add(new PropertyColumn<AnalysisRow, String>(new Model<String>(""), ""));
}
return columns;
  }
 
Example #12
Source File: OClustersWidget.java    From Orienteer with Apache License 2.0 6 votes vote down vote up
public OClustersWidget(String id, IModel<Void> model, IModel<ODocument> widgetDocumentModel) {
    super(id, model, widgetDocumentModel);


    IModel<DisplayMode> modeModel = DisplayMode.VIEW.asModel();
    List<IColumn<OCluster, String>> columns = new ArrayList<IColumn<OCluster,String>>();
    columns.add(new OClusterColumn(NAME, modeModel));
    columns.add(new OClusterMetaColumn(CONFLICT_STRATEGY, modeModel));
    columns.add(new OClusterMetaColumn(ID, modeModel));
    columns.add(new OClusterMetaColumn(COUNT, modeModel));

    AbstractJavaSortableDataProvider<OCluster, String> provider =  new OClustersDataProvider();
    provider.setSort(NAME, SortOrder.ASCENDING);
    GenericTablePanel<OCluster> tablePanel = new GenericTablePanel<OCluster>("tablePanel", columns, provider ,20);
    OrienteerDataTable<OCluster, String> table = tablePanel.getDataTable();
    addTableCommands(table, modeModel);
    add(tablePanel);
}
 
Example #13
Source File: SearchEntityPanel.java    From nextreports-server with Apache License 2.0 6 votes vote down vote up
protected List<IColumn<Entity, String>> createTableColumns() {
    List<IColumn<Entity, String>> columns = new ArrayList<IColumn<Entity, String>>();
    columns.add(new EntityNameColumn());
    columns.add(new ActionsColumn());

    if (sectionManager.getSelectedSection() instanceof ReportSection) {
        columns.add(new TypeColumn());
    }

    //columns.add(new EntityPathColumn());

    if (sectionManager.getSelectedSection() instanceof SchedulerSection) {
        columns.add(new ActivePropertyColumn());
        columns.add(new BooleanImagePropertyColumn<Entity>(new Model<String>(getString("ActionContributor.Search.entityRun")), "isRunning", "isRunning"));
        columns.add(new NextRunDateColumn<Entity>());
    }

    columns.add(new CreatedByColumn());
    columns.add(new CreationDateColumn());
    return columns;
}
 
Example #14
Source File: CustomerListPage.java    From wicket-spring-boot with Apache License 2.0 6 votes vote down vote up
private void customerDataTable(CustomerDataProvider customerDataProvider) {

		filterForm = new FilterForm<CustomerFilter>("filterForm", customerDataProvider);
		queue(filterForm);

		List<IColumn<Customer, CustomerSort>> columns = new ArrayList<>();
		columns.add(idColumn());
		columns.add(usernameColumn());
		columns.add(firstnameColumn());
		columns.add(lastnameColumn());
		columns.add(activeColumn());
		columns.add(actionColumn());

		DataTable<Customer, CustomerSort> dataTable = new AjaxFallbackDefaultDataTable<Customer, CustomerSort>("table", columns,
				customerDataProvider, 10);
		FilterToolbar filterToolbar = new FilterToolbar(dataTable, filterForm);

		dataTable.addTopToolbar(filterToolbar);
		queue(dataTable);
	}
 
Example #15
Source File: GraphNeighborsWidget.java    From Orienteer with Apache License 2.0 6 votes vote down vote up
public GraphNeighborsWidget(String id, IModel<ODocument> model, IModel<ODocument> widgetDocumentModel) {
    super(id, model, widgetDocumentModel);

    IModel<DisplayMode> modeModel = DisplayMode.VIEW.asModel();
    OQueryDataProvider<ODocument> provider = new OQueryDataProvider<ODocument>("select expand(both().asSet()) from "+getModelObject().getIdentity());
    OClass commonParent = provider.probeOClass(20);
    if(commonParent==null) commonParent = getSchema().getClass("V");
    List<IColumn<ODocument, String>> columns = oClassIntrospector.getColumnsFor(commonParent, true, modeModel);
    GenericTablePanel<ODocument> tablePanel = new GenericTablePanel<ODocument>("neighbors", columns, provider, 20);
    OrienteerDataTable<ODocument, String> table = tablePanel.getDataTable();
    table.addCommand(new CreateVertexCommand(table, getModel()));
    table.addCommand(new CreateEdgeCommand(table, getModel()));
    table.addCommand(new UnlinkVertexCommand(table, getModel()));
    table.addCommand(new DeleteVertexCommand(table, getModel()));
    table.addCommand(new EditODocumentsCommand(table, modeModel, commonParent));
    table.addCommand(new SaveODocumentsCommand(table, modeModel));
    table.addCommand(new ExportCommand<>(table, new StringResourceModel("export.filename.neighbors", new ODocumentNameModel(model))));
    add(tablePanel);
    add(DisableIfDocumentNotSavedBehavior.INSTANCE,UpdateOnActionPerformedEventBehavior.INSTANCE_ALL_CONTINUE);
}
 
Example #16
Source File: PolicyDirectoryPanel.java    From syncope with Apache License 2.0 6 votes vote down vote up
@Override
protected List<IColumn<T, String>> getColumns() {
    final List<IColumn<T, String>> columns = new ArrayList<>();

    columns.add(new KeyPropertyColumn<>(
            new StringResourceModel(Constants.KEY_FIELD_NAME, this), Constants.KEY_FIELD_NAME));
    columns.add(new PropertyColumn<>(
            new StringResourceModel("description", this), "description", "description"));
    columns.add(new CollectionPropertyColumn<>(
            new StringResourceModel("usedByResources", this), "usedByResources"));
    if (type != PolicyType.PULL && type != PolicyType.PUSH) {
        columns.add(new CollectionPropertyColumn<>(
                new StringResourceModel("usedByRealms", this), "usedByRealms"));
    }

    addCustomColumnFields(columns);

    return columns;
}
 
Example #17
Source File: EntityBrowserPanel.java    From nextreports-server with Apache License 2.0 6 votes vote down vote up
protected List<IColumn<Entity, String>> createTableColumns() {
     List<IColumn<Entity, String>> columns = new ArrayList<IColumn<Entity, String>>();
     columns.add(new NameColumn() {
     	
         private static final long serialVersionUID = 1L;

         @Override
public void onEntitySelection(Entity entity, AjaxRequestTarget target) {
             selectEntity(entity, target);
         }
         
     });
     columns.add(new ActionsColumn());
     columns.add(new TypeColumn());
     columns.add(new CreatedByColumn());
     columns.add(new CreationDateColumn());
     columns.add(new LastUpdatedByColumn());
     columns.add(new LastUpdatedDateColumn());

     return columns;
 }
 
Example #18
Source File: TimesheetListPage.java    From projectforge-webapp with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void createDataTable()
{
  final List<IColumn<TimesheetDO, String>> columns = createColumns(this, !isMassUpdateMode(), isMassUpdateMode(), form.getSearchFilter(),
      taskTree, userFormatter, dateTimeFormatter);
  dataTable = createDataTable(columns, "startTime", SortOrder.DESCENDING);
  form.add(dataTable);
}
 
Example #19
Source File: ReportletDirectoryPanel.java    From syncope with Apache License 2.0 5 votes vote down vote up
@Override
protected List<IColumn<ReportletWrapper, String>> getColumns() {
    final List<IColumn<ReportletWrapper, String>> columns = new ArrayList<>();

    columns.add(new PropertyColumn<>(
            new StringResourceModel("reportlet", this), "implementationKey", "implementationKey"));

    columns.add(new AbstractColumn<ReportletWrapper, String>(
            new StringResourceModel("configuration", this)) {

        private static final long serialVersionUID = -4008579357070833846L;

        @Override
        public void populateItem(
                final Item<ICellPopulator<ReportletWrapper>> cellItem,
                final String componentId,
                final IModel<ReportletWrapper> rowModel) {

            if (rowModel.getObject().getConf() == null) {
                cellItem.add(new Label(componentId, ""));
            } else {
                cellItem.add(new Label(componentId, rowModel.getObject().getConf().getClass().getName()));
            }
        }
    });

    return columns;
}
 
Example #20
Source File: OrienteerDataTable.java    From Orienteer with Apache License 2.0 5 votes vote down vote up
private boolean needAddFilterToolbar(FilterForm<OQueryModel<T>> filterForm) {
	final String filterId = "filter";
	for (IColumn<T, S> column : getColumns()) {
		if (column instanceof IFilteredColumn) {
			IFilteredColumn<T, S> filteredColumn = (IFilteredColumn<T, S>) column;
			Component filter = filteredColumn.getFilter(filterId, filterForm);
			if (filter != null)
				return true;
		}
	}
	return false;
}
 
Example #21
Source File: GraphVerticesWidget.java    From Orienteer with Apache License 2.0 5 votes vote down vote up
private List<IColumn<ODocument, String>> createColumns(OClass commonParent, IModel<DisplayMode> modeModel) {
	OProperty nameProperty = oClassIntrospector.getNameProperty(commonParent);
    List<IColumn<ODocument, String>> columns = oClassIntrospector.getColumnsFor(commonParent, true, modeModel);
    columns.add(new ODocumentClassColumn(new OClassModel(commonParent)));
    columns.add(new ODocumentDescriptionColumn(
    		new StringResourceModel("property.direction", this, Model.of()),
    		new DirectionLocalizer()));
    return columns;
}
 
Example #22
Source File: AjaxDataTablePanel.java    From syncope with Apache License 2.0 5 votes vote down vote up
public Builder<T, S> setColumns(final List<IColumn<T, S>> columns) {
    this.columns.clear();
    if (columns != null) {
        this.columns.addAll(columns);
    }
    return this;
}
 
Example #23
Source File: ReportTemplateDirectoryPanel.java    From syncope with Apache License 2.0 5 votes vote down vote up
@Override
protected List<IColumn<ReportTemplateTO, String>> getColumns() {
    List<IColumn<ReportTemplateTO, String>> columns = new ArrayList<>();
    columns.add(new PropertyColumn<>(
            new StringResourceModel(Constants.KEY_FIELD_NAME, this),
            Constants.KEY_FIELD_NAME, Constants.KEY_FIELD_NAME));
    return columns;
}
 
Example #24
Source File: AnyTypesPanel.java    From syncope with Apache License 2.0 5 votes vote down vote up
@Override
protected List<IColumn<AnyTypeTO, String>> getColumns() {
    final List<IColumn<AnyTypeTO, String>> columns = new ArrayList<>();

    for (Field field : AnyTypeTO.class.getDeclaredFields()) {
        if (!field.isSynthetic() && !Modifier.isStatic(field.getModifiers())) {
            final String fieldName = field.getName();
            if (field.getType().isArray()
                    || Collection.class.isAssignableFrom(field.getType())
                    || Map.class.isAssignableFrom(field.getType())) {

                columns.add(new PropertyColumn<>(
                        new ResourceModel(field.getName()), field.getName()));
            } else if (field.getType().equals(boolean.class) || field.getType().equals(Boolean.class)) {
                columns.add(new BooleanPropertyColumn<>(
                        new ResourceModel(field.getName()), field.getName(), field.getName()));
            } else {
                columns.add(new PropertyColumn<AnyTypeTO, String>(
                        new ResourceModel(field.getName()), field.getName(), field.getName()) {

                    private static final long serialVersionUID = -6902459669035442212L;

                    @Override
                    public String getCssClass() {
                        String css = super.getCssClass();
                        if (Constants.KEY_FIELD_NAME.equals(fieldName)) {
                            css = StringUtils.isBlank(css)
                                    ? "col-xs-1"
                                    : css + " col-xs-1";
                        }
                        return css;
                    }
                });
            }
        }
    }

    return columns;
}
 
Example #25
Source File: OrienteerHeadersToolbar.java    From Orienteer with Apache License 2.0 5 votes vote down vote up
private boolean needChangeColor(IColumn<T, S> column) {
    if (column instanceof IFilterSupportedColumn) {
        IFilterSupportedColumn valueColumn = (IFilterSupportedColumn) column;
        return filteredColumns.contains(valueColumn.getFilterName());
    }

    S sort = column.getSortProperty();

    return sort instanceof String && filteredColumns.contains(sort);
}
 
Example #26
Source File: OrienteerDataTable.java    From Orienteer with Apache License 2.0 5 votes vote down vote up
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);
}
 
Example #27
Source File: DomainDirectoryPanel.java    From syncope with Apache License 2.0 5 votes vote down vote up
@Override
protected List<IColumn<Domain, String>> getColumns() {
    List<IColumn<Domain, String>> columns = new ArrayList<>();
    columns.add(new PropertyColumn<>(new StringResourceModel("key", this), "key", "key"));
    columns.add(new PropertyColumn<>(
            new StringResourceModel("jdbcURL", this), "jdbcURL", "jdbcURL"));
    columns.add(new PropertyColumn<>(
            new StringResourceModel("poolMaxActive", this), "poolMaxActive", "poolMaxActive"));
    columns.add(new PropertyColumn<>(
            new StringResourceModel("poolMinIdle", this), "poolMinIdle", "poolMinIdle"));
    return columns;
}
 
Example #28
Source File: PrivilegeDirectoryPanel.java    From syncope with Apache License 2.0 5 votes vote down vote up
@Override
protected List<IColumn<PrivilegeTO, String>> getColumns() {
    final List<IColumn<PrivilegeTO, String>> columns = new ArrayList<>();

    columns.add(new PropertyColumn<>(
            new ResourceModel(Constants.KEY_FIELD_NAME), Constants.KEY_FIELD_NAME, Constants.KEY_FIELD_NAME));
    columns.add(new PropertyColumn<>(new ResourceModel("description"), "description", "description"));

    return columns;
}
 
Example #29
Source File: SecurityQuestionsPanel.java    From syncope with Apache License 2.0 5 votes vote down vote up
@Override
protected List<IColumn<SecurityQuestionTO, String>> getColumns() {
    List<IColumn<SecurityQuestionTO, String>> columns = new ArrayList<>();

    columns.add(new KeyPropertyColumn<>(
            new StringResourceModel(Constants.KEY_FIELD_NAME, this), Constants.KEY_FIELD_NAME));
    columns.add(new PropertyColumn<>(
            new StringResourceModel("content", this), "content", "content"));

    return columns;
}
 
Example #30
Source File: EditJasperParametersPanel.java    From nextreports-server with Apache License 2.0 5 votes vote down vote up
public EditJasperParametersPanel(String id, final Report report) {
        super(id);
        this.report = report;

        Label name = new Label("reportName", new Model<String>(report.getName()));
        add(name);

        List<IColumn<JasperParameterSource, String>> columns = new ArrayList<IColumn<JasperParameterSource, String>>();
        columns.add(new PropertyColumn<JasperParameterSource, String>(new Model<String>(getString("ActionContributor.EditParameters.parameterName")), "name"));
        columns.add(new ActionsColumn());
        columns.add(new TypeColumn());
        columns.add(new PropertyColumn<JasperParameterSource, String>(new Model<String>(getString("ActionContributor.EditParameters.parameterClass")), "valueClassName"));
        columns.add(new PropertyColumn<JasperParameterSource, String>(new Model<String>(getString("ActionContributor.EditParameters.parameterSelect")), "select"));
        
        dataProvider = new JasperParametersDataProvider(report);
        table = new BaseTable<JasperParameterSource>("table", columns, dataProvider, 300);
        table.setOutputMarkupId(true);
        add(table);

        add(new AjaxLink("cancel") {

            @Override
            public void onClick(AjaxRequestTarget target) {
//                if (ActionUtil.isFromSearch()) {
//                    setResponsePage(new SearchEntityPage(null));
//                } else {
//                    setResponsePage(HomePage.class);
//                }
                EntityBrowserPanel panel = findParent(EntityBrowserPanel.class);
                panel.backwardWorkspace(target);
            }
        });

    }