Search in sources :

Example 1 with ISysAdminPanel

use of org.pentaho.mantle.client.admin.ISysAdminPanel in project pentaho-platform by pentaho.

the class MantleController method activateWaitingSecurityPanel.

public void activateWaitingSecurityPanel(boolean activate) {
    if (activate && (adminPanelAwaitingActivation != null)) {
        for (int i = 0; i < MantleXul.getInstance().getAdminContentDeck().getWidgetCount(); i++) {
            Widget w = MantleXul.getInstance().getAdminContentDeck().getWidget(i);
            if (adminPanelAwaitingActivation.id.equals(w.getElement().getId())) {
                ISysAdminPanel sysAdminPanel = sysAdminPanelsMap.get(adminPanelAwaitingActivation.id);
                if (sysAdminPanel != null) {
                    sysAdminPanel.activate();
                }
                break;
            }
        }
        GWT.runAsync(new RunAsyncCallback() {

            public void onSuccess() {
                if (UserRolesAdminPanelController.getInstance().getId().equals(adminPanelAwaitingActivation.id)) {
                    model.loadUserRolesAdminPanel();
                    UserRolesAdminPanelController.getInstance().getElement().setId((UserRolesAdminPanelController.getInstance()).getId());
                } else if ((EmailAdminPanelController.getInstance()).getId().equals(adminPanelAwaitingActivation.id)) {
                    model.loadEmailAdminPanel();
                    EmailAdminPanelController.getInstance().getElement().setId((EmailAdminPanelController.getInstance()).getId());
                } else if ((ContentCleanerPanel.getInstance()).getId().equals(adminPanelAwaitingActivation.id)) {
                    model.loadSettingsPanel();
                    ContentCleanerPanel.getInstance().getElement().setId((ContentCleanerPanel.getInstance()).getId());
                } else {
                    model.loadAdminContent(adminPanelAwaitingActivation.id, adminPanelAwaitingActivation.url);
                }
            }

            public void onFailure(Throwable reason) {
            }
        });
    } else if (!activate) {
        adminPanelAwaitingActivation = null;
    }
}
Also used : RunAsyncCallback(com.google.gwt.core.client.RunAsyncCallback) Widget(com.google.gwt.user.client.ui.Widget) ISysAdminPanel(org.pentaho.mantle.client.admin.ISysAdminPanel)

Example 2 with ISysAdminPanel

use of org.pentaho.mantle.client.admin.ISysAdminPanel in project pentaho-platform by pentaho.

the class MantleController method passivateActiveSecurityPanels.

private void passivateActiveSecurityPanels(final String idOfSecurityPanelToBeActivated, final String urlOfSecurityPanelToBeActivated) {
    adminPanelAwaitingActivation = new SysAdminPanelInfo(idOfSecurityPanelToBeActivated, urlOfSecurityPanelToBeActivated);
    int visiblePanelIndex = MantleXul.getInstance().getAdminContentDeck().getVisibleWidget();
    if (visiblePanelIndex >= 0) {
        String visiblePanelId = MantleXul.getInstance().getAdminContentDeck().getWidget(visiblePanelIndex).getElement().getId();
        if ((visiblePanelId != null) && !visiblePanelId.equals(idOfSecurityPanelToBeActivated)) {
            ISysAdminPanel sysAdminPanel = sysAdminPanelsMap.get(visiblePanelId);
            if (sysAdminPanel != null) {
                sysAdminPanel.passivate(new AsyncCallback<Boolean>() {

                    public void onFailure(Throwable caught) {
                    }

                    public void onSuccess(Boolean passivateComplete) {
                        if (passivateComplete) {
                            activateWaitingSecurityPanel(passivateComplete);
                        }
                    }
                });
            } else {
                activateWaitingSecurityPanel(true);
            }
        } else {
            activateWaitingSecurityPanel(false);
        }
    } else {
        activateWaitingSecurityPanel(true);
    }
}
Also used : ISysAdminPanel(org.pentaho.mantle.client.admin.ISysAdminPanel)

Aggregations

ISysAdminPanel (org.pentaho.mantle.client.admin.ISysAdminPanel)2 RunAsyncCallback (com.google.gwt.core.client.RunAsyncCallback)1 Widget (com.google.gwt.user.client.ui.Widget)1