113 lines
3.4 KiB
Java
113 lines
3.4 KiB
Java
/**
|
|
*
|
|
*/
|
|
package org.gcube.portlets.user.td.client.toolbar;
|
|
|
|
import org.gcube.portlets.user.td.client.resource.TabularDataResources;
|
|
|
|
import com.sencha.gxt.widget.core.client.toolbar.ToolBar;
|
|
import com.google.gwt.core.client.EntryPoint;
|
|
import com.google.gwt.dom.client.Element;
|
|
import com.google.gwt.dom.client.NodeList;
|
|
import com.google.gwt.dom.client.Style.Overflow;
|
|
import com.google.gwt.user.client.ui.FlexTable;
|
|
import com.google.gwt.user.client.ui.HTML;
|
|
import com.google.gwt.user.client.ui.IsWidget;
|
|
import com.google.gwt.user.client.ui.RootPanel;
|
|
import com.google.gwt.user.client.ui.Widget;
|
|
import com.sencha.gxt.cell.core.client.ButtonCell.ButtonArrowAlign;
|
|
import com.sencha.gxt.cell.core.client.ButtonCell.ButtonScale;
|
|
import com.sencha.gxt.cell.core.client.ButtonCell.IconAlign;
|
|
import com.sencha.gxt.core.client.dom.ScrollSupport.ScrollMode;
|
|
import com.sencha.gxt.core.client.dom.XElement;
|
|
import com.sencha.gxt.widget.core.client.ContentPanel;
|
|
import com.sencha.gxt.widget.core.client.button.ButtonGroup;
|
|
import com.sencha.gxt.widget.core.client.button.TextButton;
|
|
import com.sencha.gxt.widget.core.client.button.ToggleButton;
|
|
import com.sencha.gxt.widget.core.client.container.FlowLayoutContainer;
|
|
import com.sencha.gxt.widget.core.client.container.MarginData;
|
|
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
|
|
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData;
|
|
import com.sencha.gxt.widget.core.client.menu.Menu;
|
|
import com.sencha.gxt.widget.core.client.menu.MenuItem;
|
|
import com.sencha.gxt.widget.core.client.toolbar.SeparatorToolItem;
|
|
import com.sencha.gxt.widget.core.client.toolbar.ToolBar;
|
|
|
|
/**
|
|
* @author "Federico De Faveri defaveri@isti.cnr.it"
|
|
*
|
|
*/
|
|
public class AnalysisToolBar {
|
|
|
|
protected ToolBar toolBar;
|
|
|
|
public AnalysisToolBar()
|
|
{
|
|
toolBar = new ToolBar();
|
|
build();
|
|
}
|
|
|
|
public ToolBar getToolBar()
|
|
{
|
|
return toolBar;
|
|
}
|
|
|
|
protected void build()
|
|
{
|
|
ButtonGroup group = new ButtonGroup();
|
|
group.setHeadingText("Chart");
|
|
toolBar.add(group);
|
|
|
|
FlexTable table = new FlexTable();
|
|
group.add(table);
|
|
/*
|
|
TextButton btn = new TextButton("Bar", TabularDataResources.INSTANCE.chartBar());
|
|
table.setWidget(0, 0, btn);
|
|
|
|
btn = new TextButton("Curve", TabularDataResources.INSTANCE.chartCurve());
|
|
table.setWidget(1, 0, btn);
|
|
|
|
btn = new TextButton("Pie", TabularDataResources.INSTANCE.chartPie());
|
|
table.setWidget(0, 2, btn);
|
|
|
|
btn = new TextButton("Bulls", TabularDataResources.INSTANCE.chartBullsEye());
|
|
table.setWidget(1, 2, btn);
|
|
|
|
cleanCells(table.getElement());
|
|
|
|
|
|
group = new ButtonGroup();
|
|
group.setHeadingText("External Tool");
|
|
toolBar.add(group);
|
|
|
|
table = new FlexTable();
|
|
group.add(table);
|
|
|
|
btn = new TextButton("R Studio", TabularDataResources.INSTANCE.rstudio());
|
|
table.setWidget(0, 0, btn);
|
|
|
|
btn = new TextButton("Statistical", TabularDataResources.INSTANCE.sm());
|
|
table.setWidget(1, 0, btn);
|
|
|
|
/*btn = new TextButton("Pie", TabularDataResources.INSTANCE.chartPie());
|
|
table.setWidget(0, 2, btn);
|
|
|
|
btn = new TextButton("Bulls", TabularDataResources.INSTANCE.chartBullsEye());
|
|
table.setWidget(1, 2, btn);*/
|
|
|
|
cleanCells(table.getElement());
|
|
}
|
|
|
|
protected void cleanCells(Element elem) {
|
|
NodeList<Element> tds = elem.<XElement> cast().select("td");
|
|
for (int i = 0; i < tds.getLength(); i++) {
|
|
Element td = tds.getItem(i);
|
|
|
|
if (!td.hasChildNodes() && td.getClassName().equals("")) {
|
|
td.removeFromParent();
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|