Package org.drools.guvnor.client.explorer.navigation.deployment

Source Code of org.drools.guvnor.client.explorer.navigation.deployment.SnapshotAssetListActivity

package org.drools.guvnor.client.explorer.navigation.deployment;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.VerticalPanel;
import org.drools.guvnor.client.explorer.AcceptTabItem;
import org.drools.guvnor.client.explorer.ClientFactory;
import org.drools.guvnor.client.messages.Constants;
import org.drools.guvnor.client.util.Activity;
import org.drools.guvnor.client.widgets.tables.AssetPagedTable;

import java.util.Arrays;

public class SnapshotAssetListActivity extends Activity {

    private Constants constants = GWT.create( Constants.class );
    private final ClientFactory clientFactory;
    private final SnapshotAssetListPlace place;

    public SnapshotAssetListActivity(SnapshotAssetListPlace place,
                                     ClientFactory clientFactory) {
        this.place = place;
        this.clientFactory = clientFactory;
    }

    @Override
    public void start(AcceptTabItem tabbedPanel, EventBus eventBus) {
        tabbedPanel.addTab(
                constants.SnapshotItems(),
                getPanel() );
    }

    public VerticalPanel getPanel() {
        VerticalPanel verticalPanel = new VerticalPanel();
        verticalPanel.add( new HTML( "<i><small>"
                + constants.SnapshotListingFor()
                + place.getSnapshotName()
                + "</small></i>" ) );
        verticalPanel.add(
                new AssetPagedTable(
                        place.getModuleUuid(),
                        Arrays.asList( place.getAssetTypes() ),
                        null,
                        clientFactory ) );

        return verticalPanel;
    }
}
TOP

Related Classes of org.drools.guvnor.client.explorer.navigation.deployment.SnapshotAssetListActivity

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.