
org.opencms.ui.I_CmsDialogContext Maven / Gradle / Ivy
/*
* This library is part of OpenCms -
* the Open Source Content Management System
*
* Copyright (c) Alkacon Software GmbH (http://www.alkacon.com)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* For further information about Alkacon Software, please see the
* company website: http://www.alkacon.com
*
* For further information about OpenCms, please see the
* project website: http://www.opencms.org
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.opencms.ui;
import org.opencms.file.CmsObject;
import org.opencms.file.CmsProject;
import org.opencms.file.CmsResource;
import org.opencms.ui.apps.I_CmsAppUIContext;
import org.opencms.ui.components.CmsBasicDialog.DialogWidth;
import org.opencms.util.CmsUUID;
import java.util.Collection;
import java.util.List;
import com.vaadin.ui.Component;
/**
* Context for dialogs opened from the context menu.
*/
public interface I_CmsDialogContext {
/**
* Signals an error which occurred in the dialog.
*
* @param error the error which occcurred
*/
void error(Throwable error);
/**
* Signals that the dialog has finished.
* Call when current project and or site have been changed.
*
* @param project changed project
* @param siteRoot changed site root
*/
void finish(CmsProject project, String siteRoot);
/**
* Signals that the dialog has finished.
*
* @param result the list of structure ids of changed resources
*/
void finish(Collection result);
/**
* Tell the system that the resource with the given id should be shown somehow.
*
* @param structureId the structure id of a resource
*/
void focus(CmsUUID structureId);
/**
* Gets a list of structure ids of all visible resources, not just the ones selected for the dialog.
*
* @return the structure ids of all the resources in the current view
*/
List getAllStructureIdsInView();
/**
* Returns the app UI context.
*
* @return the app UI context
*/
I_CmsAppUIContext getAppContext();
/**
* Gets the CMS context to be used for dialog operations.
*
* @return the CMS context
*/
CmsObject getCms();
/**
* Gets the list of resources for which the dialog should be opened.
*
* @return the list of resources
*/
List getResources();
/**
* Call when the dialog view has changed to re-center the dialog window.
*/
void onViewChange();
/**
* Reloads the UI.
*/
void reload();
/**
* Called to start up the dialog with the given main widget and title string.
*
* @param title the title to display
* @param dialog the dialog main widget
*/
void start(String title, Component dialog);
/**
* Called to start up the dialog with the given main widget and title string.
*
* @param title the title to display
* @param dialog the dialog main widget
* @param width the preferred width for the dialog
*/
void start(String title, Component dialog, DialogWidth width);
}