Search in sources :

Example 6 with PackageInfo

use of org.rstudio.studio.client.workbench.views.packages.model.PackageInfo in project rstudio by rstudio.

the class PackagesPane method createPackagesTable.

private void createPackagesTable() {
    try {
        packagesTableContainer_.clear();
        actionCenter_ = null;
        packagesTable_ = new DataGrid<PackageInfo>(packagesDataProvider_.getList().size(), dataGridRes_);
    } catch (Exception e) {
        // in superdevmode, try a few times 
        if (SuperDevMode.isActive()) {
            if (gridRenderRetryCount_ >= 5) {
                Debug.log("WARNING: Failed to render packages pane data grid");
            }
            gridRenderRetryCount_++;
            Debug.log("WARNING: Retrying packages data grid render (" + gridRenderRetryCount_ + ")");
            Timer t = new Timer() {

                @Override
                public void run() {
                    createPackagesTable();
                }
            };
            t.schedule(5);
        }
    }
    if (packagesTable_ != null) {
        initPackagesTable();
    }
}
Also used : Timer(com.google.gwt.user.client.Timer) PackageInfo(org.rstudio.studio.client.workbench.views.packages.model.PackageInfo)

Example 7 with PackageInfo

use of org.rstudio.studio.client.workbench.views.packages.model.PackageInfo in project rstudio by rstudio.

the class Packages method onPackageStatusChanged.

public void onPackageStatusChanged(PackageStatusChangedEvent event) {
    PackageStatus status = event.getPackageStatus();
    view_.setPackageStatus(status);
    // also update the list of allPackages_
    for (int i = 0; i < allPackages_.size(); i++) {
        PackageInfo packageInfo = allPackages_.get(i);
        if (packageInfo.getName().equals(status.getName()) && packageInfo.getLibrary().equals(status.getLib())) {
            allPackages_.set(i, status.isLoaded() ? packageInfo.asLoaded() : packageInfo.asUnloaded());
        }
    }
}
Also used : PackageInfo(org.rstudio.studio.client.workbench.views.packages.model.PackageInfo) PackageStatus(org.rstudio.studio.client.workbench.views.packages.model.PackageStatus)

Aggregations

PackageInfo (org.rstudio.studio.client.workbench.views.packages.model.PackageInfo)7 Column (com.google.gwt.user.cellview.client.Column)1 TextColumn (com.google.gwt.user.cellview.client.TextColumn)1 TextHeader (com.google.gwt.user.cellview.client.TextHeader)1 Timer (com.google.gwt.user.client.Timer)1 LayoutPanel (com.google.gwt.user.client.ui.LayoutPanel)1 TreeSet (java.util.TreeSet)1 ImageButtonColumn (org.rstudio.core.client.cellview.ImageButtonColumn)1 LinkColumn (org.rstudio.core.client.cellview.LinkColumn)1 ImageResource2x (org.rstudio.core.client.resources.ImageResource2x)1 PackageLibraryType (org.rstudio.studio.client.workbench.views.packages.model.PackageLibraryUtils.PackageLibraryType)1 PackageStatus (org.rstudio.studio.client.workbench.views.packages.model.PackageStatus)1