import com.gwtext.client.widgets.BoxComponent;
import com.gwtext.client.widgets.Component;
+
import com.gwtext.client.widgets.Panel;
import com.gwtext.client.widgets.TabPanel;
contentVPanel = new Panel();
contentVPanel.setPaddings(5);
- //contentVPanel.setHtml(Messages.getString("selectionner_la_tache"));
+
content = new Panel();
content.setBorder(false);
}else{
tabPanel.setActiveTab(1);
}
-
- //tabPanel.setActiveTab(0);
add(contentVPanel, new RowLayoutData(30));
add(content);
final Panel p2 = new Panel(Messages.getString("liste"));
p2.setId(Ext.generateId("list"));
-
p2.setLayout(new FitLayout());
+ p2.addListener(new PanelListenerAdapter() {
+
+ public void onResize(BoxComponent component, int adjWidth,
+ int adjHeight, int rawWidth, int rawHeight) {
+ if (grid != null){
+ int containerW = p2.getInnerWidth();
+ int containerH = p2.getInnerHeight();
+
+ if (grid.getWidth() != containerW
+ || grid.getHeight() != containerH) {
+
+ if (containerW > 0 && containerH > 0) {
+ grid.resizeTo(containerW, containerH );
+ }
+
+ }
+ }
+ }
+
+ public void onDestroy(Component component) {
+ if (grid != null){
+ grid.destroy();
+ }
+ }
+ });
+
+
tabPanel.add(p1);
tabPanel.add(p2);
tabPanel.addListener(new TabPanelListenerAdapter(){
-
- @Override
public boolean doBeforeTabChange(TabPanel source, Panel newPanel,
Panel oldPanel) {
- // TODO Auto-generated method stub
+
return true;
}
-
- @Override
public void onTabChange(TabPanel source, Panel tab) {
if (tab.getId().startsWith("tree")){
+ Cookies.setCookie("taskView", "tree");
if (tree == null) {
- Cookies.setCookie("taskView", "tree");
+
tree = new TreeTodoListWidget(mcp, me);
tab.add(tree);
}else if (tab.getId().startsWith("list")){
+ Cookies.setCookie("taskView", "list");
if (grid == null) {
- Cookies.setCookie("taskView", "list");
+
grid = new SmartTodoListWidget(mcp, me);
grid.initializeInterface();
- tab.addListener(new PanelListenerAdapter() {
-
- public void onResize(BoxComponent component, int adjWidth,
- int adjHeight, int rawWidth, int rawHeight) {
-
- int containerW = p2.getInnerWidth();
- int containerH = p2.getInnerHeight();
-
- if (grid.getWidth() != containerW
- || grid.getHeight() != containerH) {
-
- if (containerW > 0 && containerH > 0) {
-
- grid.resizeTo(containerW, containerH );
-
-
- }
-
- }
-
- }
-
- public void onDestroy(Component component) {
- grid.destroy();
-
- }
-
- });
- tab.add(grid);
grid.updateTodoList();
+ tab.add(grid);
+
+ tab.setSize(tabPanel.getInnerWidth()-2, tabPanel.getInnerHeight());
tab.doLayout();
+
}
-
-
-
}
}
});
content.add(tabPanel);
-
-
- /**/
-
}
public void setContentVPanelHtml(String html){