Search in sources :

Example 1 with DocumentMenuItem

use of org.kie.workbench.common.widgets.metadata.client.menu.RegisteredDocumentsMenuView.DocumentMenuItem in project kie-wb-common by kiegroup.

the class RegisteredDocumentsMenuBuilder method makeDocumentMenuItem.

DocumentMenuItem makeDocumentMenuItem(final KieDocument document) {
    final DocumentMenuItem documentMenuItem = documentMenuItemProvider.get();
    documentMenuItem.setName(document.getCurrentPath().getFileName());
    documentMenuItem.setRemoveDocumentCommand(() -> onRemoveDocument(document));
    documentMenuItem.setActivateDocumentCommand(() -> onActivateDocument(document));
    documentMenuItem.setReadOnly(document.isReadOnly());
    return documentMenuItem;
}
Also used : DocumentMenuItem(org.kie.workbench.common.widgets.metadata.client.menu.RegisteredDocumentsMenuView.DocumentMenuItem)

Example 2 with DocumentMenuItem

use of org.kie.workbench.common.widgets.metadata.client.menu.RegisteredDocumentsMenuView.DocumentMenuItem in project kie-wb-common by kiegroup.

the class RegisteredDocumentsMenuBuilder method registerDocument.

@Override
public void registerDocument(final KieDocument document) {
    final DocumentMenuItem documentMenuItem = makeDocumentMenuItem(document);
    registeredDocuments.put(document, documentMenuItem);
    view.addDocument(documentMenuItem);
}
Also used : DocumentMenuItem(org.kie.workbench.common.widgets.metadata.client.menu.RegisteredDocumentsMenuView.DocumentMenuItem)

Example 3 with DocumentMenuItem

use of org.kie.workbench.common.widgets.metadata.client.menu.RegisteredDocumentsMenuView.DocumentMenuItem in project kie-wb-common by kiegroup.

the class RegisteredDocumentsMenuBuilder method deregisterDocument.

@Override
public void deregisterDocument(final KieDocument document) {
    final DocumentMenuItem documentMenuItem = registeredDocuments.remove(document);
    documentMenuItemProvider.destroy(documentMenuItem);
    view.deleteDocument(documentMenuItem);
}
Also used : DocumentMenuItem(org.kie.workbench.common.widgets.metadata.client.menu.RegisteredDocumentsMenuView.DocumentMenuItem)

Aggregations

DocumentMenuItem (org.kie.workbench.common.widgets.metadata.client.menu.RegisteredDocumentsMenuView.DocumentMenuItem)3