Search in sources :

Example 1 with PresentationEditor

use of com.haulmont.cuba.web.gui.components.presentations.PresentationEditor in project cuba by cuba-platform.

the class AbstractEditPresentationAction method createEditor.

protected PresentationEditor createEditor(Presentation presentation) {
    Class<? extends PresentationEditor> windowClass = getPresentationEditorClass();
    PresentationEditor window;
    try {
        Constructor<? extends PresentationEditor> windowConstructor = windowClass.getConstructor(Presentation.class, Component.HasPresentations.class);
        window = windowConstructor.newInstance(presentation, table);
    } catch (NoSuchMethodException | InstantiationException | IllegalAccessException | InvocationTargetException e) {
        throw new DevelopmentException("Invalid presentation's screen");
    }
    return window;
}
Also used : PresentationEditor(com.haulmont.cuba.web.gui.components.presentations.PresentationEditor) Component(com.haulmont.cuba.gui.components.Component) InvocationTargetException(java.lang.reflect.InvocationTargetException) DevelopmentException(com.haulmont.cuba.core.global.DevelopmentException)

Example 2 with PresentationEditor

use of com.haulmont.cuba.web.gui.components.presentations.PresentationEditor in project cuba by cuba-platform.

the class AbstractEditPresentationAction method openEditor.

protected void openEditor(Presentation presentation) {
    PresentationEditor window = createEditor(presentation);
    AppUI.getCurrent().addWindow(window);
    window.center();
}
Also used : PresentationEditor(com.haulmont.cuba.web.gui.components.presentations.PresentationEditor)

Aggregations

PresentationEditor (com.haulmont.cuba.web.gui.components.presentations.PresentationEditor)2 DevelopmentException (com.haulmont.cuba.core.global.DevelopmentException)1 Component (com.haulmont.cuba.gui.components.Component)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1