Search in sources :

Example 1 with RaisePackagePaneEvent

use of org.rstudio.studio.client.workbench.views.packages.events.RaisePackagePaneEvent in project rstudio by rstudio.

the class PackagesPane method setActions.

@Override
public void setActions(ArrayList<Packages.Action> actions) {
    // command that manages the layout of the packages list and action center
    Command manageActionCenterLayout = new Command() {

        @Override
        public void execute() {
            resizeActionCenter();
        }
    };
    if (actions == null || actions.size() == 0) {
        if (actionCenter_ != null) {
            packagesTableContainer_.remove(actionCenter_);
            actionCenter_ = null;
            layoutPackagesTable();
            packagesTableContainer_.animate(ACTION_CENTER_ANIMATION_MS);
        }
    } else {
        // in a non-collapsed center, raise the packages pane
        if (actionCenter_ == null || ((!actionCenter_.collapsed()) && (actionCenter_.getActionCount() != actions.size()))) {
            events_.fireEvent(new RaisePackagePaneEvent());
        }
        // create the action center if it doesn't already exist
        if (actionCenter_ == null) {
            actionCenter_ = new ActionCenter(manageActionCenterLayout);
            packagesTableContainer_.add(actionCenter_);
        }
        actionCenter_.setActions(actions);
        resizeActionCenter();
    }
}
Also used : Command(com.google.gwt.user.client.Command) RaisePackagePaneEvent(org.rstudio.studio.client.workbench.views.packages.events.RaisePackagePaneEvent) ActionCenter(org.rstudio.studio.client.workbench.views.packages.ui.actions.ActionCenter)

Aggregations

Command (com.google.gwt.user.client.Command)1 RaisePackagePaneEvent (org.rstudio.studio.client.workbench.views.packages.events.RaisePackagePaneEvent)1 ActionCenter (org.rstudio.studio.client.workbench.views.packages.ui.actions.ActionCenter)1