Search in sources :

Example 1 with CubaFoldersPane

use of com.haulmont.cuba.web.app.folders.CubaFoldersPane in project cuba by cuba-platform.

the class WebFilterHelper method saveFolder.

@Override
@Nullable
public AbstractSearchFolder saveFolder(AbstractSearchFolder folder) {
    Window.TopLevelWindow topLevelWindow = AppUI.getCurrent().getTopLevelWindow();
    FoldersPane foldersPane = null;
    if (topLevelWindow instanceof Window.HasFoldersPane) {
        foldersPane = ((Window.HasFoldersPane) topLevelWindow).getFoldersPane();
    }
    if (foldersPane == null)
        return null;
    CubaFoldersPane foldersPaneImpl = foldersPane.unwrap(CubaFoldersPane.class);
    AbstractSearchFolder savedFolder = (AbstractSearchFolder) foldersPaneImpl.saveFolder(folder);
    foldersPaneImpl.refreshFolders();
    return savedFolder;
}
Also used : AppFolderEditWindow(com.haulmont.cuba.web.app.folders.AppFolderEditWindow) FolderEditWindow(com.haulmont.cuba.web.app.folders.FolderEditWindow) FoldersPane(com.haulmont.cuba.gui.components.mainwindow.FoldersPane) CubaFoldersPane(com.haulmont.cuba.web.app.folders.CubaFoldersPane) CubaFoldersPane(com.haulmont.cuba.web.app.folders.CubaFoldersPane) AbstractSearchFolder(com.haulmont.cuba.core.entity.AbstractSearchFolder) Nullable(javax.annotation.Nullable)

Example 2 with CubaFoldersPane

use of com.haulmont.cuba.web.app.folders.CubaFoldersPane in project cuba by cuba-platform.

the class WebFilterHelper method removeFolderFromFoldersPane.

@Override
public void removeFolderFromFoldersPane(Folder folder) {
    Window.TopLevelWindow topLevelWindow = AppUI.getCurrent().getTopLevelWindow();
    FoldersPane foldersPane = null;
    if (topLevelWindow instanceof Window.HasFoldersPane) {
        foldersPane = ((Window.HasFoldersPane) topLevelWindow).getFoldersPane();
    }
    if (foldersPane == null) {
        return;
    }
    CubaFoldersPane foldersPaneImpl = foldersPane.unwrap(CubaFoldersPane.class);
    foldersPaneImpl.removeFolder(folder);
    foldersPaneImpl.refreshFolders();
}
Also used : AppFolderEditWindow(com.haulmont.cuba.web.app.folders.AppFolderEditWindow) FolderEditWindow(com.haulmont.cuba.web.app.folders.FolderEditWindow) FoldersPane(com.haulmont.cuba.gui.components.mainwindow.FoldersPane) CubaFoldersPane(com.haulmont.cuba.web.app.folders.CubaFoldersPane) CubaFoldersPane(com.haulmont.cuba.web.app.folders.CubaFoldersPane)

Aggregations

FoldersPane (com.haulmont.cuba.gui.components.mainwindow.FoldersPane)2 AppFolderEditWindow (com.haulmont.cuba.web.app.folders.AppFolderEditWindow)2 CubaFoldersPane (com.haulmont.cuba.web.app.folders.CubaFoldersPane)2 FolderEditWindow (com.haulmont.cuba.web.app.folders.FolderEditWindow)2 AbstractSearchFolder (com.haulmont.cuba.core.entity.AbstractSearchFolder)1 Nullable (javax.annotation.Nullable)1