Search in sources :

Example 1 with ArtifactListView

use of org.guvnor.m2repo.client.widgets.ArtifactListView in project kie-wb-common by kiegroup.

the class ArtifactSelectorView method init.

@Override
public void init(final ArtifactSelectorPresenter presenter) {
    this.presenter = presenter;
    final ArtifactListView artifactListView = presenter.getArtifactListView();
    artifactListView.addColumn(buildSelectColumn(), getSelectColumnLabel());
    artifactListView.setContentHeight("200px");
    final Style style = artifactListView.asWidget().getElement().getStyle();
    style.setMarginLeft(0, Style.Unit.PX);
    style.setMarginRight(0, Style.Unit.PX);
    artifactListContainer.add(artifactListView);
}
Also used : ArtifactListView(org.guvnor.m2repo.client.widgets.ArtifactListView) Style(com.google.gwt.dom.client.Style)

Example 2 with ArtifactListView

use of org.guvnor.m2repo.client.widgets.ArtifactListView in project kie-wb-common by kiegroup.

the class ArtifactListWidgetView method init.

@Override
public void init(final ArtifactListWidgetPresenter presenter) {
    this.presenter = presenter;
    search.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            presenter.search(filter.getText());
        }
    });
    final ArtifactListView artifactListView = presenter.getArtifactListView();
    artifactListView.addColumn(buildSelectColumn(), getSelectColumnLabel());
    artifactListView.setContentHeight("200px");
    final Style style = artifactListView.asWidget().getElement().getStyle();
    style.setMarginLeft(0, Style.Unit.PX);
    style.setMarginRight(0, Style.Unit.PX);
    panel.add(artifactListView);
}
Also used : ArtifactListView(org.guvnor.m2repo.client.widgets.ArtifactListView) ClickHandler(com.google.gwt.event.dom.client.ClickHandler) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) Style(com.google.gwt.dom.client.Style)

Example 3 with ArtifactListView

use of org.guvnor.m2repo.client.widgets.ArtifactListView 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);
}
Also used : ArtifactListView(org.guvnor.m2repo.client.widgets.ArtifactListView) Column(com.google.gwt.user.cellview.client.Column) JarListPageRow(org.guvnor.m2repo.model.JarListPageRow) ButtonCell(org.gwtbootstrap3.client.ui.gwt.ButtonCell) PostConstruct(javax.annotation.PostConstruct)

Aggregations

ArtifactListView (org.guvnor.m2repo.client.widgets.ArtifactListView)3 Style (com.google.gwt.dom.client.Style)2 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)1 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)1 Column (com.google.gwt.user.cellview.client.Column)1 PostConstruct (javax.annotation.PostConstruct)1 JarListPageRow (org.guvnor.m2repo.model.JarListPageRow)1 ButtonCell (org.gwtbootstrap3.client.ui.gwt.ButtonCell)1