Search in sources :

Example 11 with Metadata

use of org.jboss.hal.meta.Metadata in project console by hal.

the class StoreElement method tableForm.

private Form<ModelNode> tableForm(CacheType cacheType, Store store, Table table, MetadataRegistry metadataRegistry) {
    AddressTemplate template = cacheType.template.append(STORE + "=" + store.resource).append(TABLE + "=" + table.resource);
    Metadata metadata = metadataRegistry.lookup(template);
    String id = Ids.build(cacheType.baseId, store.baseId, table.baseId, Ids.FORM);
    return new ModelNodeForm.Builder<>(id, metadata).include(PREFIX).customFormItem(ID_COLUMN, ad -> new ColumnFormItem(ID_COLUMN)).customFormItem(DATA_COLUMN, ad -> new ColumnFormItem(DATA_COLUMN)).customFormItem(TIMESTAMP_COLUMN, ad -> new ColumnFormItem(TIMESTAMP_COLUMN)).include(BATCH_SIZE, FETCH_SIZE).unsorted().onSave((f, changedValues) -> presenter.saveTable(table, changedValues)).prepareReset(f -> presenter.resetTable(table, f)).build();
}
Also used : AddressTemplate(org.jboss.hal.meta.AddressTemplate) ModelNode(org.jboss.hal.dmr.ModelNode) IsElement(org.jboss.gwt.elemento.core.IsElement) JQuery.$(org.jboss.hal.ballroom.JQuery.$) CSS.bootstrapSelect(org.jboss.hal.resources.CSS.bootstrapSelect) HashMap(java.util.HashMap) Tabs(org.jboss.hal.ballroom.Tabs) ModelNodeForm(org.jboss.hal.core.mbui.form.ModelNodeForm) Property(org.jboss.hal.dmr.Property) AddressTemplate(org.jboss.hal.meta.AddressTemplate) HTMLElement(elemental2.dom.HTMLElement) Map(java.util.Map) EmptyState(org.jboss.hal.ballroom.EmptyState) HTMLSelectElement(elemental2.dom.HTMLSelectElement) HasPresenter(org.jboss.hal.core.mvp.HasPresenter) Metadata(org.jboss.hal.meta.Metadata) Names(org.jboss.hal.resources.Names) Ids(org.jboss.hal.resources.Ids) CSS(org.jboss.hal.resources.CSS) CSS.btnGroup(org.jboss.hal.resources.CSS.btnGroup) CSS.selectpicker(org.jboss.hal.resources.CSS.selectpicker) ModelNodeHelper.failSafeGet(org.jboss.hal.dmr.ModelNodeHelper.failSafeGet) List(java.util.List) Collectors.toList(java.util.stream.Collectors.toList) MetadataRegistry(org.jboss.hal.meta.MetadataRegistry) Resources(org.jboss.hal.resources.Resources) ModelDescriptionConstants(org.jboss.hal.dmr.ModelDescriptionConstants) CSS.width(org.jboss.hal.resources.CSS.width) Attachable(org.jboss.hal.ballroom.Attachable) Elements(org.jboss.gwt.elemento.core.Elements) SelectBoxBridge(org.jboss.hal.ballroom.form.SelectBoxBridge) Form(org.jboss.hal.ballroom.form.Form) Metadata(org.jboss.hal.meta.Metadata) ModelNodeForm(org.jboss.hal.core.mbui.form.ModelNodeForm)

Example 12 with Metadata

use of org.jboss.hal.meta.Metadata in project console by hal.

the class LoggingProfileView method savePatternFormatter.

void savePatternFormatter(Form<NamedNode> form, Map<String, Object> changedValues) {
    String name = form.getModel().getName();
    Metadata metadata = mbuiContext.metadataRegistry().lookup(LOGGING_PROFILE_TEMPLATE.append(PATTERN_FORMATTER + EQ_WILDCARD));
    saveForm(Names.PATTERN_FORMATTER, name, SELECTED_LOGGING_PROFILE_TEMPLATE.append(PATTERN_FORMATTER + EQ_WILDCARD).resolve(selectionAwareStatementContext, name), changedValues, metadata);
}
Also used : Metadata(org.jboss.hal.meta.Metadata)

Example 13 with Metadata

use of org.jboss.hal.meta.Metadata in project console by hal.

the class LoggingProfileView method resetSizeHandler.

void resetSizeHandler(Form<NamedNode> form) {
    String name = form.getModel().getName();
    Metadata metadata = mbuiContext.metadataRegistry().lookup(LOGGING_PROFILE_TEMPLATE.append(SIZE_ROTATING_FILE_HANDLER + EQ_WILDCARD));
    resetForm(Names.SIZE_ACTION_HANDLER, name, SELECTED_LOGGING_PROFILE_TEMPLATE.append(SIZE_ROTATING_FILE_HANDLER + EQ_WILDCARD).resolve(selectionAwareStatementContext, name), form, metadata);
}
Also used : Metadata(org.jboss.hal.meta.Metadata)

Example 14 with Metadata

use of org.jboss.hal.meta.Metadata in project console by hal.

the class LoggingProfileView method resetCustomHandler.

void resetCustomHandler(Form<NamedNode> form) {
    String name = form.getModel().getName();
    Metadata metadata = mbuiContext.metadataRegistry().lookup(LOGGING_PROFILE_TEMPLATE.append(CUSTOM_HANDLER + EQ_WILDCARD));
    resetForm(Names.CUSTOM_ACTION_HANDLER, name, SELECTED_LOGGING_PROFILE_TEMPLATE.append(CUSTOM_HANDLER + EQ_WILDCARD).resolve(selectionAwareStatementContext, name), form, metadata);
}
Also used : Metadata(org.jboss.hal.meta.Metadata)

Example 15 with Metadata

use of org.jboss.hal.meta.Metadata in project console by hal.

the class LoggingProfileView method resetConsoleHandler.

void resetConsoleHandler(Form<NamedNode> form) {
    String name = form.getModel().getName();
    Metadata metadata = mbuiContext.metadataRegistry().lookup(LOGGING_PROFILE_TEMPLATE.append(CONSOLE_HANDLER + EQ_WILDCARD));
    resetForm(Names.CONSOLE_ACTION_HANDLER, name, SELECTED_LOGGING_PROFILE_TEMPLATE.append(CONSOLE_HANDLER + EQ_WILDCARD).resolve(selectionAwareStatementContext, name), form, metadata);
}
Also used : Metadata(org.jboss.hal.meta.Metadata)

Aggregations

Metadata (org.jboss.hal.meta.Metadata)281 ResourceAddress (org.jboss.hal.dmr.ResourceAddress)146 ModelNode (org.jboss.hal.dmr.ModelNode)128 ModelNodeForm (org.jboss.hal.core.mbui.form.ModelNodeForm)95 AddResourceDialog (org.jboss.hal.core.mbui.dialog.AddResourceDialog)80 NamedNode (org.jboss.hal.dmr.NamedNode)73 Ids (org.jboss.hal.resources.Ids)70 Form (org.jboss.hal.ballroom.form.Form)68 Names (org.jboss.hal.resources.Names)67 ModelDescriptionConstants (org.jboss.hal.dmr.ModelDescriptionConstants)63 Resources (org.jboss.hal.resources.Resources)60 List (java.util.List)59 Operation (org.jboss.hal.dmr.Operation)59 AddressTemplate (org.jboss.hal.meta.AddressTemplate)59 Inject (javax.inject.Inject)52 Map (java.util.Map)51 StatementContext (org.jboss.hal.meta.StatementContext)51 Dispatcher (org.jboss.hal.dmr.dispatch.Dispatcher)50 EventBus (com.google.web.bindery.event.shared.EventBus)49 MetadataRegistry (org.jboss.hal.meta.MetadataRegistry)46