com.google.gwt.view.client.SingleSelectionModel Java Examples

The following examples show how to use com.google.gwt.view.client.SingleSelectionModel. 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: ServerList.java    From core with GNU Lesser General Public License v2.1 6 votes vote down vote up
public ServerList(CommonHttpPresenter presenter, boolean isRuntimeView) {

        this.presenter = presenter;
        this.isRuntimeView = isRuntimeView;

        ProvidesKey<Property> keyProvider = new ProvidesKey<Property>() {
            @Override
            public Object getKey(Property property) {
                return property.getName();
            }
        };

        if (isRuntimeView)
        {
            this.RESOURCE_ADDRESS = AddressTemplate.of("/{implicit.host}/{selected.server}/subsystem=undertow/server=*");
        }
        else
        {
            this.RESOURCE_ADDRESS = AddressTemplate.of("{selected.profile}/subsystem=undertow/server={undertow.server}");
        }

        this.table = new DefaultCellTable(5, keyProvider);
        this.dataProvider = new ListDataProvider<Property>();
        this.dataProvider.addDataDisplay(table);
        this.table.setSelectionModel(new SingleSelectionModel<Property>(keyProvider));
    }
 
Example #2
Source File: HandlerEditor.java    From core with GNU Lesser General Public License v2.1 6 votes vote down vote up
public HandlerEditor(Dispatcher circuit, SecurityContext securityContext,
                     AddressTemplate addressTemplate,
                     ResourceDescription resourceDescription) {

    this.securityContext = securityContext;
    this.resourceDescription = resourceDescription;
    this.circuit = circuit;
    this.addressTemplate = addressTemplate;

    ProvidesKey<Property> providesKey = Property::getName;

    table = new DefaultCellTable<>(5, providesKey);
    dataProvider = new ListDataProvider<>(providesKey);
    selectionModel = new SingleSelectionModel<>(providesKey);
    //noinspection unchecked
    dataProvider.addDataDisplay(table);
    table.setSelectionModel(selectionModel);
}
 
Example #3
Source File: WebServiceRuntimeView.java    From core with GNU Lesser General Public License v2.1 6 votes vote down vote up
public void updateEndpoints(List<WebServiceEndpoint> endpoints) {
    ((SingleSelectionModel) table.getSelectionModel()).clear();

    dataProvider.setList(endpoints);
    sortHandler.setList(dataProvider.getList());

    // Make sure the new values are properly sorted
    ColumnSortEvent.fire(table, table.getColumnSortList());

    table.selectDefaultEntity();
    WebServiceEndpoint selection = selectionModel.getSelectedObject();
    addSample(selection);

   /* ((SingleSelectionModel)table.getSelectionModel()).clear();
    dataProvider.setList(endpoints);
    table.selectDefaultEntity();*/

}
 
Example #4
Source File: ConfigEditorWS.java    From core with GNU Lesser General Public License v2.1 6 votes vote down vote up
public ConfigEditorWS(DispatchAsync dispatcher, Dispatcher circuit, SecurityContext securityContext,
        StatementContext statementContext, AddressTemplate addressTemplate,
        ResourceDescription resourceDescription, String title, WebServicePresenter presenter) {

    this.circuit = circuit;
    this.dispatcher = dispatcher;
    this.securityContext = securityContext;
    this.statementContext = statementContext;
    this.addressTemplate = addressTemplate;
    this.resourceDescription = resourceDescription;
    this.title = title;
    this.presenter = presenter;

    ProvidesKey<Property> providesKey = Property::getName;

    table = new DefaultCellTable<>(5, providesKey);
    dataProvider = new ListDataProvider<>(providesKey);
    selectionModel = new SingleSelectionModel<>(providesKey);
    dataProvider.addDataDisplay(table);
    table.setSelectionModel(selectionModel);
}
 
Example #5
Source File: NewIdentityAttributesView.java    From core with GNU Lesser General Public License v2.1 6 votes vote down vote up
NewIdentityAttributesView(final Dispatcher circuit, ResourceDescription resourceDescription,
        SecurityContext securityContext) {

    this.circuit = circuit;
    this.securityContext = securityContext;
    this.nameProvider = modelNode -> modelNode.get(NAME);
    selectionModel = new SingleSelectionModel<>(nameProvider);

    // tweak to use ModelNodeFormBuilder automatic form generation
    this.resourceDescription = new ResourceDescription(resourceDescription.clone());
    // adds the identity-mappings.new-identity-attributes to the request-properties of add operation
    ModelNode reqPropsDescription = this.resourceDescription.get(OPERATIONS).get(ADD).get(REQUEST_PROPERTIES);
    // adds the identity-mappings.new-identity-attributes to the attribute list
    ModelNode attrPropsDescription = this.resourceDescription.get(ATTRIBUTES);
    ModelNode newIdentityAttributesDescription = reqPropsDescription.get("identity-mapping").get(VALUE_TYPE).get("new-identity-attributes").get(VALUE_TYPE);
    reqPropsDescription.set(newIdentityAttributesDescription);
    attrPropsDescription.set(newIdentityAttributesDescription);

}
 
Example #6
Source File: RemotingEditor.java    From core with GNU Lesser General Public License v2.1 6 votes vote down vote up
RemotingEditor(DispatchAsync dispatcher, SecurityContext securityContext,
               StatementContext statementContext, AddressTemplate addressTemplate,
               ResourceDescription resourceDescription) {
    this.dispatcher = dispatcher;
    this.securityContext = securityContext;
    this.statementContext = statementContext;
    this.addressTemplate = addressTemplate;
    this.resourceDescription = resourceDescription;

    ProvidesKey<Property> providesKey = new ProvidesKey<Property>() {
        @Override
        public Object getKey(Property item) {
            return item.getName();
        }
    };
    table = new DefaultCellTable<>(5, providesKey);
    dataProvider = new ListDataProvider<>(providesKey);
    selectionModel = new SingleSelectionModel<>(providesKey);
    //noinspection unchecked
    dataProvider.addDataDisplay(table);
    table.setSelectionModel(selectionModel);
}
 
Example #7
Source File: IdentityAttributeMappingView.java    From core with GNU Lesser General Public License v2.1 6 votes vote down vote up
IdentityAttributeMappingView(final Dispatcher circuit, ResourceDescription resourceDescription,
        SecurityContext securityContext) {
    this.circuit = circuit;
    this.securityContext = securityContext;
    selectionModel = new SingleSelectionModel<>();

    // tweak to use ModelNodeFormBuilder automatic form generation
    this.resourceDescription = new ResourceDescription(resourceDescription.clone());
    // adds the identity-mappings.new-identity-attributes to the request-properties of add operation
    ModelNode reqPropsDescription = this.resourceDescription.get(OPERATIONS).get(ADD).get(REQUEST_PROPERTIES);
    // adds the identity-mappings.new-identity-attributes to the attribute list
    ModelNode attrPropsDescription = this.resourceDescription.get(ATTRIBUTES);
    ModelNode newIdentityAttributesDescription = reqPropsDescription.get("identity-mapping").get(VALUE_TYPE)
            .get("attribute-mapping").get(VALUE_TYPE);
    reqPropsDescription.set(newIdentityAttributesDescription);
    attrPropsDescription.set(newIdentityAttributesDescription);

}
 
Example #8
Source File: DriverStep.java    From core with GNU Lesser General Public License v2.1 6 votes vote down vote up
@Override
protected boolean onNext(final Context<T> context) {
    JDBCDriver driver = null;
    if (selectedTab == 0) {
        FormValidation formValidation = form.validate();
        if (!formValidation.hasErrors()) {
            driver = form.getUpdatedEntity();
        }
    } else {
        form.clearValues();
        SingleSelectionModel<JDBCDriver> selection =
                (SingleSelectionModel<JDBCDriver>) table.getSelectionModel();
        driver = selection.getSelectedObject();
    }

    if (driver != null) {
        wizard.applyDriver(driver);
        return true;
    } else {
        Console.warning(Console.CONSTANTS.noDriverSpecified());
        return false;
    }
}
 
Example #9
Source File: MasterDetailEditor.java    From core with GNU Lesser General Public License v2.1 6 votes vote down vote up
MasterDetailEditor(final SecurityContext securityContext,
        final StatementContext statementContext,
        final ResourceDescription resourceDescription,
        final String resourceName) {
    this.securityContext = securityContext;
    this.statementContext = statementContext;
    this.resourceDescription = resourceDescription;
    this.resourceName = resourceName;

    //noinspection Convert2MethodRef
    ProvidesKey<Property> providesKey = item -> item.getName();
    table = new DefaultCellTable<>(5, providesKey);
    dataProvider = new ListDataProvider<>(providesKey);
    selectionModel = new SingleSelectionModel<>(providesKey);
    //noinspection unchecked
    dataProvider.addDataDisplay(table);
    table.setSelectionModel(selectionModel);
}
 
Example #10
Source File: IOPanel.java    From core with GNU Lesser General Public License v2.1 6 votes vote down vote up
@SuppressWarnings("unchecked")
public IOPanel(AddressTemplate address, IOPresenter presenter) {
    this.address = address;
    this.presenter = presenter;
    this.providesKey = new ProvidesKey<Property>() {
        @Override
        public Object getKey(Property item) {
            return item.getName();
        }
    };
    this.table = new DefaultCellTable<>(5, providesKey);
    this.dataProvider = new ListDataProvider<Property>(providesKey);
    this.selectionModel = new SingleSelectionModel<Property>(providesKey);

    dataProvider.addDataDisplay(table);
    table.setSelectionModel(selectionModel);
}
 
Example #11
Source File: AuthenticationContextMatchRulesEditor.java    From core with GNU Lesser General Public License v2.1 6 votes vote down vote up
AuthenticationContextMatchRulesEditor(final Dispatcher circuit, ResourceDescription resourceDescription,
        SecurityContext securityContext) {
    this.circuit = circuit;
    this.securityContext = securityContext;
    selectionModel = new SingleSelectionModel<>();

    // tweak to use ModelNodeFormBuilder automatic form generation
    this.resourceDescription = new ResourceDescription(resourceDescription.clone());
    // adds the match-rules to the request-properties of add operation
    ModelNode reqPropsDescription = this.resourceDescription.get(OPERATIONS).get(ADD).get(REQUEST_PROPERTIES);
    // adds the mechanism-configuration to the attribute list
    ModelNode attrPropsDescription = this.resourceDescription.get(ATTRIBUTES);
    ModelNode matchRulesDescription = reqPropsDescription.get(MATCH_RULES).get(VALUE_TYPE);
    reqPropsDescription.set(matchRulesDescription);
    attrPropsDescription.set(matchRulesDescription);
}
 
Example #12
Source File: ConnectorMetricView.java    From core with GNU Lesser General Public License v2.1 6 votes vote down vote up
public ConnectorMetricView(HttpMetricPresenter presenter) {

        this.presenter = presenter;
        this.table = new DefaultCellTable(5);

        ProvidesKey<Property> keyProvider = new ProvidesKey<Property>() {
            @Override
            public Object getKey(Property property) {
                return property.getName();
            }
        };

        this.dataProvider = new ListDataProvider<Property>(keyProvider);
        this.dataProvider.addDataDisplay(table);
        this.table.setSelectionModel(new SingleSelectionModel<Property>(keyProvider));
    }
 
Example #13
Source File: PooledConnectionFactoryRuntimeView.java    From core with GNU Lesser General Public License v2.1 6 votes vote down vote up
Widget asWidget() {
    serverName = new ContentHeaderLabel();

    ProvidesKey<Property> providesKey = Property::getName;
    table = new DefaultCellTable<>(10, providesKey);
    provider = new ListDataProvider<>(providesKey);
    provider.addDataDisplay(table);
    selectionModel = new SingleSelectionModel<>(providesKey);

    setupTable();

    formPanel = new VerticalPanel();
    formPanel.setStyleName("fill-layout-width");

    MultipleToOneLayout layout = new MultipleToOneLayout()
            .setPlain(true)
            .setHeadlineWidget(serverName)
            .setDescription(SafeHtmlUtils.fromString(Console.CONSTANTS.subsys_messaging_pooled_stats_desc()))
            .setMaster(Console.MESSAGES.available("Pooled Connection Factory"), table)
            .setMasterTools(setupMasterTools())
            .addDetail("Pool Statistics", formPanel.asWidget());

    return layout.build();
}
 
Example #14
Source File: HostView.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
public HostView(HttpPresenter presenter) {
    this.presenter = presenter;
    this.table = new DefaultCellTable(5);
    this.dataProvider = new ListDataProvider<Property>();
    this.dataProvider.addDataDisplay(table);
    this.table.setSelectionModel(new SingleSelectionModel<Property>());
    securityContext = presenter.getSecurityFramework().getSecurityContext(presenter.getProxy().getNameToken());
    definition = presenter.getDescriptionRegistry().lookup(BASE_ADDRESS);
    filterRefEditor = new FilterRefEditor(presenter, BASE_ADDRESS.append("filter-ref=*"));
    selectionModel = new SingleSelectionModel<>();
}
 
Example #15
Source File: GenericListComplexAttribute.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
GenericListComplexAttribute(final Dispatcher circuit, ResourceDescription resourceDescription,
        SecurityContext securityContext, AddressTemplate template, String complexAttributeName) {
    this.circuit = circuit;
    this.securityContext = securityContext;
    this.template = template;
    this.complexAttributeName = complexAttributeName;
    selectionModel = new SingleSelectionModel<>();

    this.resourceDescription = new ResourceDescription(resourceDescription.clone());
    ModelNode reqPropsDescription = this.resourceDescription.get(OPERATIONS).get(ADD).get(REQUEST_PROPERTIES);
    ModelNode nestedAttributes = reqPropsDescription.get(complexAttributeName).get(VALUE_TYPE);
    reqPropsDescription.set(nestedAttributes);
    this.resourceDescription.get(ATTRIBUTES).set(resourceDescription.get(ATTRIBUTES).get(complexAttributeName).get(VALUE_TYPE));
}
 
Example #16
Source File: ConfigurableSaslServerFactoryFilterEditor.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
ConfigurableSaslServerFactoryFilterEditor(final Dispatcher circuit, ResourceDescription resourceDescription,
        SecurityContext securityContext) {
    this.circuit = circuit;
    this.securityContext = securityContext;
    selectionModel = new SingleSelectionModel<>();

    this.resourceDescription = new ResourceDescription(resourceDescription.clone());
    // rewrite the resource descriptor to allow the use of ModelNodeFormBuilder
    ModelNode reqPropsDescription = this.resourceDescription.get("operations").get("add").get("request-properties");
    ModelNode mechanismDescription = reqPropsDescription.get(FILTERS).get("value-type");
    reqPropsDescription.set(mechanismDescription);
}
 
Example #17
Source File: ConfigurableHttpServerMechanismFactoryFilterEditor.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
ConfigurableHttpServerMechanismFactoryFilterEditor(final Dispatcher circuit, ResourceDescription resourceDescription,
        SecurityContext securityContext) {
    this.circuit = circuit;
    this.securityContext = securityContext;
    this.nameProvider = modelNode -> modelNode.get("pattern-filter");
    selectionModel = new SingleSelectionModel<>(nameProvider);

    this.resourceDescription = new ResourceDescription(resourceDescription.clone());
    ModelNode reqPropsDescription = this.resourceDescription.get("operations").get("add").get("request-properties");
    ModelNode filtersDescription = reqPropsDescription.get("filters").get("value-type");
    reqPropsDescription.set(filtersDescription);
}
 
Example #18
Source File: MechanismProviderFilteringSaslServerFilterEditor.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
MechanismProviderFilteringSaslServerFilterEditor(final Dispatcher circuit, ResourceDescription resourceDescription,
        SecurityContext securityContext) {
    this.circuit = circuit;
    this.securityContext = securityContext;
    this.nameProvider = modelNode -> modelNode.get("provider-name");
    selectionModel = new SingleSelectionModel<>(nameProvider);

    this.resourceDescription = new ResourceDescription(resourceDescription.clone());
    ModelNode reqPropsDescription = this.resourceDescription.get(OPERATIONS).get(ADD).get(REQUEST_PROPERTIES);
    ModelNode filtersDescription = reqPropsDescription.get("filters").get(VALUE_TYPE);
    reqPropsDescription.set(filtersDescription);
}
 
Example #19
Source File: ColumnFilter.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
public ColumnFilter(SingleSelectionModel<T> selection, CellTable<T> delegate, Predicate predicate) {
    this.selection = selection;
    this.delegate = delegate;
    this.predicate = predicate;

    delegate.addRowCountChangeHandler(new RowCountChangeEvent.Handler() {
        @Override
        public void onRowCountChange(RowCountChangeEvent event) {
            if (!isFilterActive()) {
                origValues = delegate.getVisibleItems();
            }
        }
    });
}
 
Example #20
Source File: SecurityDomainRealmEditor.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
SecurityDomainRealmEditor(final Dispatcher circuit, ResourceDescription resourceDescription,
        SecurityContext securityContext) {
    this.circuit = circuit;
    this.securityContext = securityContext;
    selectionModel = new SingleSelectionModel<>();

    this.resourceDescription = new ResourceDescription(resourceDescription.clone());
    ModelNode reqPropsDescription = this.resourceDescription.get("operations").get("add").get("request-properties");
    ModelNode filtersDescription = reqPropsDescription.get("realms").get("value-type");
    reqPropsDescription.set(filtersDescription);
}
 
Example #21
Source File: SocketTable.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
public void updateFrom(String groupName, List<SocketBinding> bindings) {

        ((SingleSelectionModel)table.getSelectionModel()).clear();
        List<SocketBinding> list = dataProvider.getList();
        list.clear(); // cannot call setList() as that breaks the sort handler
        list.addAll(bindings);
        dataProvider.flush();

        table.selectDefaultEntity();
    }
 
Example #22
Source File: SimplePermissionMappingEditor.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
SimplePermissionMappingEditor(final Dispatcher circuit, ResourceDescription resourceDescription,
        SecurityContext securityContext) {
    this.circuit = circuit;
    this.securityContext = securityContext;
    selectionModel = new SingleSelectionModel<>();

    this.resourceDescription = new ResourceDescription(resourceDescription.clone());
    ModelNode reqPropsDescription = this.resourceDescription.get(OPERATIONS).get(ADD).get(REQUEST_PROPERTIES);
    ModelNode filtersDescription = reqPropsDescription.get("permission-mappings").get(VALUE_TYPE);
    reqPropsDescription.set(filtersDescription);
}
 
Example #23
Source File: ContainerList.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
public ContainerList(ServletPresenter presenter) {

        this.presenter = presenter;
        this.table = new DefaultCellTable(5);
        this.dataProvider = new ListDataProvider<Property>();
        this.dataProvider.addDataDisplay(table);
        this.table.setSelectionModel(new SingleSelectionModel<Property>());
    }
 
Example #24
Source File: ApplicationSecurityDomainView.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
public ApplicationSecurityDomainView(EJB3Presenter presenter) {
    this.presenter = presenter;
    this.selectionModel = new SingleSelectionModel<>();
    ProvidesKey<Property> providesKey = Property::getName;
    this.table = new DefaultCellTable<>(5, providesKey);
    this.table.setSelectionModel(selectionModel);
    this.dataProvider = new ListDataProvider<>(providesKey);
    this.dataProvider.addDataDisplay(this.table);
}
 
Example #25
Source File: DataProviderFilter.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
private void clearSelection() {
    for (HasData<T> table : delegate.getDataDisplays()) {
        SelectionModel<? super T> selectionModel = table.getSelectionModel();
        if (selectionModel instanceof SingleSelectionModel) {
            SingleSelectionModel<T> sm = (SingleSelectionModel<T>) selectionModel;
            T selectedObject = sm.getSelectedObject();
            if (selectedObject != null) {
                ((SingleSelectionModel<T>) selectionModel).setSelected(selectedObject, false);
            }
        }
    }
}
 
Example #26
Source File: FilterEditor.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
public FilterEditor(FilterPresenter presenter, AddressTemplate addressTemplate, String title, boolean showDeprecated) {
    this.presenter = presenter;
    this.showDeprecated = showDeprecated;
    ProvidesKey<Property> providesKey = Property::getName;
    this.selectionModel = new SingleSelectionModel<>(providesKey);
    this.table = new DefaultCellTable(5, providesKey);
    this.table.setSelectionModel(selectionModel);
    this.dataProvider = new ListDataProvider<>(providesKey);
    this.dataProvider.addDataDisplay(table);
    securityContext = presenter.getSecurityFramework().getSecurityContext(presenter.getProxy().getNameToken());
    definition = presenter.getDescriptionRegistry().lookup(addressTemplate);
    this.addressTemplate = addressTemplate;
    this.title = title;
}
 
Example #27
Source File: JMSBridgeList.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
JMSBridgeList(JMSBridgePresenter presenter) {
    this.presenter = presenter;
    ProvidesKey<Property> providesKey = Property::getName;
    this.table = new DefaultCellTable<>(8, providesKey);
    this.dataProvider = new ListDataProvider<>(providesKey);
    this.dataProvider.addDataDisplay(table);
    this.selectionModel = new SingleSelectionModel<>(providesKey);
    this.table.setSelectionModel(selectionModel);
}
 
Example #28
Source File: GenericAliasEditor.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
GenericAliasEditor(ResourceDescription resourceDescription, SecurityContext securityContext) {

        this.resourceDescription = new ResourceDescription();
        this.resourceDescription.get(OPERATIONS).get(ADD).set(resourceDescription.get(OPERATIONS).get(ADD_ALIAS_OPERATION));
        this.resourceDescription.get(ATTRIBUTES).set(resourceDescription.get(OPERATIONS).get(ADD_ALIAS_OPERATION).get(REQUEST_PROPERTIES));
        this.securityContext = securityContext;
        selectionModel = new SingleSelectionModel<>();
    }
 
Example #29
Source File: TemplateUploadWizard.java    From appinventor-extensions with Apache License 2.0 5 votes vote down vote up
/**
 * Creates the scrollable list of cells each of which serves as a link to a template.
 *
 * @param list an ArrayList of TemplateInfo
 * @return A CellList widget
 */
public CellList<TemplateInfo> makeTemplateSelector(ArrayList<TemplateInfo> list) {
  TemplateCell templateCell = new TemplateCell(list.get(0), templateHostUrl);

  CellList<TemplateInfo> templateCellList = new CellList<TemplateInfo>(templateCell,TemplateInfo.KEY_PROVIDER);
  templateCellList.setPageSize(list.size() + 10);
  templateCellList.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.ENABLED);
  templateCellList.setWidth("250px");
  templateCellList.setHeight("355px");
  templateCellList.setVisible(true);
  templateCellList.getElement().getStyle().setOverflowY(Style.Overflow.SCROLL);

  // Add a selection model to handle user selection.
  final SingleSelectionModel<TemplateInfo> selectionModel =
    new SingleSelectionModel<TemplateInfo>(TemplateInfo.KEY_PROVIDER);
  templateCellList.setSelectionModel(selectionModel);
  selectionModel.setSelected(list.get(0), true);
  final TemplateUploadWizard wizard = this;
  selectionModel.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
      public void onSelectionChange(SelectionChangeEvent event) {
        TemplateInfo selected = selectionModel.getSelectedObject();
        if (selected != null) {
          selectedTemplateNAME = selected.name;
          TemplateWidget.setTemplate(selected, wizard.getTemplateUrlHost());
        }
      }
    });

  // Set the total row count. This isn't strictly necessary, but it affects
  // paging calculations, so its good habit to keep the row count up to date.
  templateCellList.setRowCount(list.size(), true);

  // Push the data into the widget.
  templateCellList.setRowData(0, list);
  return templateCellList;
}
 
Example #30
Source File: PooledConnectionFactoryView.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
@SuppressWarnings("unchecked")
Widget asWidget() {
    serverName = new ContentHeaderLabel();

    ProvidesKey<Property> providesKey = Property::getName;
    table = new DefaultCellTable<>(10, providesKey);
    provider = new ListDataProvider<>(providesKey);
    provider.addDataDisplay(table);
    selectionModel = new SingleSelectionModel<>(providesKey);

    setupTable();

    VerticalPanel formPanel = new VerticalPanel();
    formPanel.setStyleName("fill-layout-width");
    formPanel.add(modelForm.getHelp().asWidget());
    formPanel.add(modelForm.getForm().asWidget());

    MultipleToOneLayout layout = new MultipleToOneLayout()
            .setPlain(true)
            .setHeadlineWidget(serverName)
            .setDescription(SafeHtmlUtils.fromString(pooledConnectionDescription.get(DESCRIPTION).asString()))
            .setMaster(Console.MESSAGES.available("Pooled Connection Factory"), table)
            .setMasterTools(setupMasterTools())
            .addDetail(Console.CONSTANTS.common_label_attributes(), formPanel.asWidget());

    return layout.build();
}