83 lines
2.2 KiB
Java
83 lines
2.2 KiB
Java
package org.gcube.portlets.user.statisticalalgorithmsimporter.client.tools;
|
|
|
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.event.ProjectStatusEvent;
|
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.tools.input.InputVariablePanel;
|
|
|
|
import com.allen_sauer.gwt.log.client.Log;
|
|
import com.google.gwt.event.shared.EventBus;
|
|
import com.sencha.gxt.core.client.util.Margins;
|
|
import com.sencha.gxt.widget.core.client.container.MarginData;
|
|
import com.sencha.gxt.widget.core.client.container.SimpleContainer;
|
|
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
|
|
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData;
|
|
|
|
/**
|
|
*
|
|
* @author giancarlo email: <a
|
|
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
|
*
|
|
*/
|
|
public class ToolsPanel extends SimpleContainer {
|
|
|
|
private EventBus eventBus;
|
|
private InputVariablePanel inputVariablePanel;
|
|
private ExplorerProjectPanel explorerProjectPanel;
|
|
private boolean first = true;
|
|
|
|
public ToolsPanel(EventBus eventBus) {
|
|
super();
|
|
this.eventBus = eventBus;
|
|
init();
|
|
create();
|
|
bindToEvents();
|
|
}
|
|
|
|
protected void init() {
|
|
forceLayoutOnResize = true;
|
|
// setBodyBorder(false);
|
|
setBorders(false);
|
|
// setHeaderVisible(false);
|
|
|
|
}
|
|
|
|
protected void create() {
|
|
|
|
}
|
|
|
|
private void bindToEvents() {
|
|
eventBus.addHandler(ProjectStatusEvent.TYPE,
|
|
new ProjectStatusEvent.ProjectStatusEventHandler() {
|
|
|
|
@Override
|
|
public void onProjectStatus(ProjectStatusEvent event) {
|
|
Log.debug("Catch ShowCodeEvent");
|
|
doProjectStatusCommand(event);
|
|
|
|
}
|
|
});
|
|
}
|
|
|
|
private void doProjectStatusCommand(ProjectStatusEvent event) {
|
|
if (first) {
|
|
first = false;
|
|
addPanel();
|
|
} else {
|
|
|
|
}
|
|
}
|
|
|
|
private void addPanel() {
|
|
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
|
|
|
inputVariablePanel = new InputVariablePanel(eventBus);
|
|
explorerProjectPanel = new ExplorerProjectPanel(eventBus);
|
|
v.add(inputVariablePanel, new VerticalLayoutData(1, -1, new Margins(0)));
|
|
v.add(explorerProjectPanel, new VerticalLayoutData(1, -1,
|
|
new Margins(0)));
|
|
add(v, new MarginData(new Margins(0)));
|
|
forceLayout();
|
|
|
|
}
|
|
|
|
}
|