use of org.guvnor.m2repo.model.JarListPageRow in project kie-wb-common by kiegroup.
the class DependencyListWidget method init.
@PostConstruct
public void init() {
dependencyPagedJarTable = IOC.getBeanManager().lookupBean(ArtifactListPresenter.class).getInstance();
dependencyPagedJarTable.setup(ColumnType.NAME, ColumnType.GAV, ColumnType.LAST_MODIFIED);
// Column to view KJAR's pom
final Column<JarListPageRow, String> openColumn = new Column<JarListPageRow, String>(new ButtonCell(ButtonSize.EXTRA_SMALL)) {
@Override
public String getValue(JarListPageRow row) {
return M2RepoEditorConstants.INSTANCE.Open();
}
};
openColumn.setFieldUpdater(new FieldUpdater<JarListPageRow, String>() {
@Override
public void update(int index, JarListPageRow row, String value) {
dependencyPagedJarTable.onOpenPom(row.getPath());
}
});
// Column to allow selection of dependency
final Column<JarListPageRow, String> selectColumn = new Column<JarListPageRow, String>(new ButtonCell(ButtonSize.EXTRA_SMALL)) {
@Override
public String getValue(JarListPageRow row) {
return ProjectEditorResources.CONSTANTS.Select();
}
};
selectColumn.setFieldUpdater(new FieldUpdater<JarListPageRow, String>() {
@Override
public void update(final int index, final JarListPageRow row, final String value) {
onPathSelect.execute(row.getPath());
}
});
final ArtifactListView artifactListView = dependencyPagedJarTable.getView();
artifactListView.addColumn(openColumn, M2RepoEditorConstants.INSTANCE.Open(), false, 100.0, Style.Unit.PX);
artifactListView.addColumn(selectColumn, ProjectEditorResources.CONSTANTS.Select(), 100.0, Style.Unit.PX);
artifactListView.setContentHeight("200px");
artifactListView.asWidget().getElement().getStyle().setMarginLeft(0, Style.Unit.PX);
artifactListView.asWidget().getElement().getStyle().setMarginRight(0, Style.Unit.PX);
panel.add(artifactListView);
}
Aggregations