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

The following examples show how to use com.google.gwt.view.client.ProvidesKey. 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: 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 #2
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 #3
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 #4
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 #5
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 #6
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 #7
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 #8
Source File: PropertyEditor.java    From core with GNU Lesser General Public License v2.1 6 votes vote down vote up
private PropertyEditor(Builder builder) {
    this.propertyManager = builder.propertyManager;
    this.keyProvider = new ProvidesKey<Property>() {
        @Override
        public Object getKey(Property property) {
            return property.getName();
        }
    };

    this.operationAddress = builder.operationAddress;
    this.inlineEditing = builder.inlineEditing;
    this.hideTools = builder.hideTools;
    this.numRows = builder.numRows;
    this.addLabel = builder.addLabel;
    this.addDialog = builder.addDialog;
    this.removeLabel = builder.removeLabel;
}
 
Example #9
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 #10
Source File: EndpointTable.java    From core with GNU Lesser General Public License v2.1 6 votes vote down vote up
public EndpointTable() {
    super(8, new ProvidesKey<JMSEndpoint>() {
        @Override
        public Object getKey(JMSEndpoint item) {
            return item.getEntries();
        }
    });

    TextColumn<JMSEndpoint> nameColumn = new TextColumn<JMSEndpoint>() {
        @Override
        public String getValue(JMSEndpoint record) {
            return record.getName();
        }
    };
    JMSEndpointJndiColumn<JMSEndpoint> jndiColumn = new JMSEndpointJndiColumn<JMSEndpoint>();

    addColumn(nameColumn, "Name");
    addColumn(jndiColumn, "JNDI");

}
 
Example #11
Source File: MasterDetailTemplate.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
public MasterDetailTemplate(LoggerPresenter presenter, AddressTemplate address, String title) {
    this.presenter = presenter;
    this.address = address;
    this.title = title;
    ProvidesKey<Property> providesKey = Property::getName;
    this.table = new DefaultCellTable(5, providesKey);
    this.dataProvider = new ListDataProvider<Property>(providesKey);
    this.dataProvider.addDataDisplay(table);
}
 
Example #12
Source File: AbstractListenerView.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
public AbstractListenerView(HttpPresenter presenter, AddressTemplate baseAddress, String entityName) {
    this.presenter = presenter;
    this.baseAddress = baseAddress;
    this.entityName = entityName;

    ProvidesKey<Property> providesKey = Property::getName;
    this.table = new DefaultCellTable<>(5, providesKey);
    this.dataProvider = new ListDataProvider<>(providesKey);
    this.dataProvider.addDataDisplay(table);
    this.table.setSelectionModel(new SingleSelectionModel<Property>());
}
 
Example #13
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 #14
Source File: CategoryView.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
public CategoryView(LoggerPresenter presenter) {
    this.presenter = presenter;
    ProvidesKey<Property> providesKey = Property::getName;
    this.table = new DefaultCellTable<>(5, providesKey);
    this.dataProvider = new ListDataProvider<>(providesKey);
    this.dataProvider.addDataDisplay(table);
}
 
Example #15
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 #16
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();
}
 
Example #17
Source File: PassivationView.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
public PassivationView(EJB3Presenter presenter, AddressTemplate address, String title) {
    this.presenter = presenter;
    this.address = address;
    this.title = title;
    this.keyprovider = new ProvidesKey<Property>() {
        @Override
        public Object getKey(Property property) {
            return property.getName();
        }
    };
    this.table = new DefaultCellTable(5, keyprovider);
    this.dataProvider = new ListDataProvider<Property>(keyprovider);
    this.dataProvider.addDataDisplay(table);
}
 
Example #18
Source File: ServiceViewTemplate.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
public ServiceViewTemplate(EEPresenter presenter, String title, AddressTemplate address) {

        this.title = title;
        this.presenter = presenter;
        this.address = address;
        ProvidesKey<Property> providesKey = Property::getName;
        this.table = new DefaultCellTable<>(5, providesKey);
        this.dataProvider = new ListDataProvider<>(providesKey);
        this.dataProvider.addDataDisplay(table);
    }
 
Example #19
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 #20
Source File: ThreadPoolView.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
public ThreadPoolView(EJB3Presenter presenter) {
    this.presenter = presenter;
    ProvidesKey<Property> providesKey = Property::getName;
    this.table = new DefaultCellTable<>(5, providesKey);
    this.dataProvider = new ListDataProvider<>(providesKey);
    this.dataProvider.addDataDisplay(table);
}
 
Example #21
Source File: BeanPoolView.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
public BeanPoolView(EJB3Presenter presenter) {
    this.presenter = presenter;
    ProvidesKey<Property> providesKey = Property::getName;
    this.table = new DefaultCellTable(5, providesKey);
    this.dataProvider = new ListDataProvider<>(providesKey);
    this.dataProvider.addDataDisplay(table);
}
 
Example #22
Source File: CachesView.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
public CachesView(EJB3Presenter presenter) {
    this.presenter = presenter;
    ProvidesKey<Property> providesKey = Property::getName;
    this.table = new DefaultCellTable<>(5, providesKey);
    this.dataProvider = new ListDataProvider<>(providesKey);
    this.dataProvider.addDataDisplay(table);
}
 
Example #23
Source File: RemotingProfileView.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
public RemotingProfileView(EJB3Presenter presenter) {
    this.presenter = presenter;
    ProvidesKey<Property> providesKey = Property::getName;
    this.table = new DefaultCellTable<>(5, providesKey);
    this.dataProvider = new ListDataProvider<>(providesKey);
    this.dataProvider.addDataDisplay(table);
}
 
Example #24
Source File: DatasourceTable.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
public DatasourceTable() {
    this.dataSourceTable = new DefaultCellTable<DataSource>(
            PAGE_SIZE,
            new ProvidesKey<DataSource>() {
                @Override
                public Object getKey(DataSource item) {
                    return item.getJndiName();
                }
            });

}
 
Example #25
Source File: SocketTable.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
public SocketTable() {
    table = new DefaultCellTable<SocketBinding>(8, new ProvidesKey<SocketBinding>() {
        @Override
        public Object getKey(SocketBinding item) {
            return item.getName()+String.valueOf(item.getGroup());
        }
    });
    dataProvider = new ListDataProvider<SocketBinding>();
    dataProvider.addDataDisplay(table);
}
 
Example #26
Source File: ModelNodeCellTable.java    From core with GNU Lesser General Public License v2.1 4 votes vote down vote up
public ModelNodeCellTable(final int pageSize,
        final ProvidesKey<ModelNode> keyProvider)
{
    super(pageSize, keyProvider);
}
 
Example #27
Source File: DefaultCellList.java    From core with GNU Lesser General Public License v2.1 4 votes vote down vote up
public DefaultCellList(final Cell<T> cell, final ProvidesKey<T> keyProvider) {
    super(cell, RESOURCES, keyProvider);
}
 
Example #28
Source File: FinderColumn.java    From core with GNU Lesser General Public License v2.1 4 votes vote down vote up
public FinderColumn(final FinderId correlationId, final String title, final Display display, final ProvidesKey keyProvider, String token) {
    this(correlationId, title, display, keyProvider, token, 500);
}
 
Example #29
Source File: HostJVMView.java    From core with GNU Lesser General Public License v2.1 4 votes vote down vote up
@Override
public Widget createWidget() {

    ProvidesKey<Property> providesKey = Property::getName;
    selectionModel = new SingleSelectionModel<>(providesKey);
    selectionModel.addSelectionChangeHandler(event -> updateDetail(selectionModel.getSelectedObject()));
    table = new DefaultCellTable<>(8, providesKey);
    table.setSelectionModel(selectionModel);
    dataProvider = new ListDataProvider<>(providesKey);
    dataProvider.addDataDisplay(table);

    ToolStrip toolStrip = new ToolStrip();

    ToolButton addBtn= new ToolButton(Console.CONSTANTS.common_label_add(),
            event -> presenter.launchNewJVMDialogue());
    addBtn.ensureDebugId(Console.DEBUG_CONSTANTS.debug_label_add_hostJVMView());
    toolStrip.addToolButtonRight(addBtn);

    ToolButton removeBtn = new ToolButton(Console.CONSTANTS.common_label_delete(), event -> {

        final Property entity = selectionModel.getSelectedObject();

        Feedback.confirm(
                Console.MESSAGES.deleteTitle("JVM Configuration"),
                Console.MESSAGES.deleteConfirm("JVM Configuration '" + entity.getName() + "'"),
                isConfirmed -> {
                    if (isConfirmed)
                        presenter.onDeleteJvm("", entity.getName());
                });

    });
    removeBtn.ensureDebugId(Console.DEBUG_CONSTANTS.debug_label_add_hostJVMView());
    toolStrip.addToolButtonRight(removeBtn);

    // ---

    TextColumn<Property> nameCol = new TextColumn<Property>() {
        @Override
        public String getValue(Property object) {
            return object.getName();
        }
    };


    table.addColumn(nameCol, "Name");
    //table.addColumn(debugCol, "IsDebugEnabled?");

    ResourceDescription resourceDescription = resourceDescriptionRegistry.lookup(HostJVMPresenter.ROOT_ADDRESS_TEMPLATE);
    SecurityContext securityContext = securityFramework.getSecurityContext(presenter.getProxy().getNameToken());

    jvmEditor = new JvmEditor(presenter, resourceDescription, securityContext, HostJVMPresenter.ROOT_ADDRESS);
    jvmEditor.setEnableClearButton(false);

    MultipleToOneLayout layout = new MultipleToOneLayout()
            .setTitle("JVM Configurations")
            .setPlain(true)
            .setDescription(SafeHtmlUtils.fromString(Console.CONSTANTS.hosts_jvm_desc()))
            .setHeadline(Console.CONSTANTS.hosts_jvm_title())
            .setMaster(Console.MESSAGES.available("JVM Configurations"), table)
            .setMasterTools(toolStrip)
            .setDetail(Console.CONSTANTS.common_label_selection(), jvmEditor.asWidget());

    return layout.build();
}
 
Example #30
Source File: CellTreeNodeView.java    From consulo with Apache License 2.0 4 votes vote down vote up
/**
 * Reload the open children after rendering new items in this node.
 *
 * @param values     the values being replaced
 * @param start      the start index
 * @param savedViews the open nodes
 */
private void loadChildState(List<C> values, int start, Map<Object, CellTreeNodeView<?>> savedViews) {
  int len = values.size();
  int end = start + len;
  int childCount = nodeView.getChildCount();
  int setSize = (childCount > len) ? childCount : end;
  ProvidesKey<C> keyProvider = nodeInfo.getProvidesKey();

  Element container = nodeView.ensureChildContainer();
  Element childElem = (values.size() == 0) ? null : Element.as(container.getChild(start));
  CellTreeNodeView<?> keyboardSelected = nodeView.tree.getKeyboardSelectedNode();
  for (int i = start; i < end; i++) {
    C childValue = values.get(i - start);
    CellTreeNodeView<C> child = nodeView.createTreeNodeView(nodeInfo, childElem, childValue, null);
    CellTreeNodeView<?> savedChild = savedViews.remove(keyProvider.getKey(childValue));
    // Copy the saved child's state into the new child
    if (savedChild != null) {
      child.animationFrame = savedChild.animationFrame;
      child.contentContainer = savedChild.contentContainer;
      child.childContainer = savedChild.childContainer;
      child.children = savedChild.children;
      child.emptyMessageElem = savedChild.emptyMessageElem;
      child.nodeInfo = savedChild.nodeInfo;
      child.nodeInfoLoaded = savedChild.nodeInfoLoaded;
      child.open = savedChild.open;
      child.showMoreElem = savedChild.showMoreElem;

      // Transfer the tree node so that if the user has a handle to it, it
      // won't be destroyed.
      child.treeNode = savedChild.treeNode;
      if (child.treeNode != null) {
        child.treeNode.nodeView = child;
      }

      // Swap the node view in the child. We reuse the same NodeListView
      // so that we don't have to unset and register a new view with the
      // NodeInfo, which would inevitably cause the NodeInfo to push
      // new data.
      child.listView = savedChild.listView;
      if (child.listView != null) {
        child.listView.nodeView = child;
      }

      // Set the new parent of the grandchildren.
      if (child.children != null) {
        for (CellTreeNodeView<?> grandchild : child.children) {
          grandchild.parentNode = child;
        }
      }

      // Transfer the keyboard selected node.
      if (keyboardSelected == savedChild) {
        keyboardSelected = child;
      }

      // Copy the child container element to the new child
      child.getElement().appendChild(savedChild.ensureAnimationFrame());

      // Mark the old child as destroy without actually destroying it.
      savedChild.isDestroyed = true;
    }

    if (childCount > i) {
      nodeView.children.set(i, child);
    }
    else {
      nodeView.children.add(child);
    }
    child.updateAriaAttributes(setSize);
    childElem = childElem.getNextSiblingElement();
  }

  // Move the keyboard selected node if it is this node or a child of this
  // node.
  CellTreeNodeView<?> curNode = keyboardSelected;
  while (curNode != null) {
    if (curNode == nodeView) {
      nodeView.tree.keyboardSelect(keyboardSelected, false);
      break;
    }
    curNode = curNode.parentNode;
  }
}