Exemplo n.º 1
0
 protected ViewForm createViewForm() {
   ViewForm viewForm = new ViewForm(container, SWT.NONE);
   GridData gd = new GridData(GridData.FILL_BOTH);
   viewForm.setLayoutData(gd);
   viewForm.setLayout(new FillLayout());
   return viewForm;
 }
Exemplo n.º 2
0
  protected Control createContents(Composite parent) {
    ViewForm form = new ViewForm(parent, SWT.NONE);
    form.setSize(400, 290);
    final Composite shell = new Composite(form.getShell(), SWT.NONE);
    Label lbApp1 = new Label(shell, SWT.NONE);
    lbApp1.setText("Version:");
    lbApp1.setBounds(10, 10, 50, 20);
    controls.add(lbApp1);
    Label lbApp2 = new Label(shell, SWT.NONE);
    lbApp2.setText("noti-J 1.0");
    lbApp2.setBounds(UIUtils.getBoundsH(lbApp1, 10, 100));
    controls.add(lbApp2);

    Label lbStatus1 = new Label(shell, SWT.NONE);
    lbStatus1.setText("State:");
    lbStatus1.setBounds(UIUtils.getBoundsV(lbApp1, 10));
    controls.add(lbStatus1);
    Label lbStatus2 = new Label(shell, SWT.NONE);
    lbStatus2.setText(connected ? "connected" : "disconnect");
    lbStatus2.setForeground(
        Display.getDefault().getSystemColor(connected ? SWT.COLOR_BLUE : SWT.COLOR_RED));
    lbStatus2.setBounds(UIUtils.getBoundsV(lbApp2, 10));
    controls.add(lbStatus2);

    Label lbUser1 = new Label(shell, SWT.NONE);
    lbUser1.setText("Account:");
    lbUser1.setBounds(UIUtils.getBoundsV(lbStatus1, 10));
    controls.add(lbUser1);
    Label lbUser2 = new Label(shell, SWT.NONE);
    lbUser2.setText(userid + "(" + userName + ")");
    lbUser2.setBounds(UIUtils.getBoundsV(lbStatus2, 10));
    controls.add(lbUser2);

    Label lbLic1 = new Label(shell, SWT.NONE);
    lbLic1.setText("License:");
    lbLic1.setBounds(UIUtils.getBoundsV(lbUser1, 10));
    controls.add(lbLic1);
    Label lbLic2 = new Label(shell, SWT.NONE);
    lbLic2.setText("GPL 3.0");
    lbLic2.setBounds(UIUtils.getBoundsV(lbUser2, 10));
    controls.add(lbLic2);

    Label lbDev1 = new Label(shell, SWT.NONE);
    lbDev1.setText("Author:");
    lbDev1.setBounds(UIUtils.getBoundsV(lbLic1, 10));
    controls.add(lbDev1);
    Label lbDev2 = new Label(shell, SWT.NONE);
    lbDev2.setText("Jong-Bok,Park([email protected])");
    lbDev2.setBounds(UIUtils.getBoundsV(lbLic2, 10, 300));
    controls.add(lbDev2);

    Text txError = new Text(shell, SWT.NONE | SWT.WRAP);
    txError.setText(errorMsg == null ? "" : errorMsg);
    txError.setBounds(UIUtils.getBoundsV(lbDev1, 10, 300, 100));
    txError.setEditable(false);
    controls.add(txError);
    controls.add(form);
    return form;
  }
  public void createPartControl(Composite parent) {
    ViewForm topComp = new ViewForm(parent, SWT.NONE);
    topComp.setLayout(new FillLayout());
    createTableViewer(topComp);
    tv.setContentProvider(new SmsContentProvider());
    tv.setLabelProvider(new TableViewerLabelProvider());

    ArchiveRecentReadEditorActionGroup actionGroup = new ArchiveRecentReadEditorActionGroup(tv);
    ToolBar toolBar = new ToolBar(topComp, SWT.FLAT);
    ToolBarManager toolBarManager = new ToolBarManager(toolBar);
    actionGroup.fillActionToolBars(toolBarManager);

    topComp.setContent(tv.getControl());
    topComp.setTopLeft(toolBar);
    actionGroup.fireFirstAction();
  }
 public void propertyChange(PropertyChangeEvent event) {
   if (!disposed) {
     setColorsAndFonts();
     // viewMessage.setSize(viewMessage.computeSize(SWT.DEFAULT, SWT.DEFAULT, true));
     viewForm.layout(true);
   }
 }
  private void createMemoryBlocksTreeViewPane(Composite parent) {

    fMemBlkViewer = new MemoryBlocksTreeViewPane(this);
    fViewPanes.put(MemoryBlocksTreeViewPane.PANE_ID, fMemBlkViewer);
    ViewForm viewerViewForm = new ViewForm(parent, SWT.NONE);
    PlatformUI.getWorkbench()
        .getHelpSystem()
        .setHelp(
            viewerViewForm, IDebugUIConstants.PLUGIN_ID + ".MemoryView_context"); // $NON-NLS-1$
    fViewPaneControls.put(MemoryBlocksTreeViewPane.PANE_ID, viewerViewForm);
    fWeights.add(Integer.valueOf(15));

    fMemBlkViewer.addSelectionListener(fSelectionProvider);

    Control viewerControl =
        fMemBlkViewer.createViewPane(
            viewerViewForm,
            MemoryBlocksTreeViewPane.PANE_ID,
            DebugUIMessages.MemoryView_Memory_monitors);
    viewerViewForm.setContent(viewerControl);

    ISelection selection = fMemBlkViewer.getSelectionProvider().getSelection();
    if (selection != null) fSelectionProvider.setSelection(selection);

    ToolBarManager viewerToolBarMgr = new ToolBarManager(SWT.FLAT);
    IAction[] actions = fMemBlkViewer.getActions();
    for (int i = 0; i < actions.length; i++) {
      viewerToolBarMgr.add(actions[i]);
    }
    ToolBar viewerToolbar = viewerToolBarMgr.createControl(viewerViewForm);
    viewerViewForm.setTopRight(viewerToolbar);

    Label viewerLabel = new Label(viewerViewForm, SWT.WRAP);
    viewerLabel.setText(DebugUIMessages.MemoryView_Memory_monitors);
    viewerViewForm.setTopLeft(viewerLabel);

    fMemBlkViewer
        .getControl()
        .addFocusListener(
            new FocusAdapter() {
              @Override
              public void focusGained(FocusEvent e) {
                fActivePaneId = fMemBlkViewer.getId();
              }
            });
  }
Exemplo n.º 6
0
 /**
  * Creates a {@link ViewForm}
  *
  * @param parent
  * @param style
  * @param cols
  * @param span
  * @param fill
  * @param marginwidth
  * @param marginheight
  * @return a new {@link ViewForm}
  * @since 3.6
  */
 public static ViewForm createViewform(
     Composite parent,
     int style,
     int cols,
     int span,
     int fill,
     int marginwidth,
     int marginheight) {
   ViewForm form = new ViewForm(parent, style);
   form.setFont(parent.getFont());
   GridLayout layout = new GridLayout(cols, false);
   layout.marginWidth = marginwidth;
   layout.marginHeight = marginheight;
   form.setLayout(layout);
   GridData gd = new GridData(fill);
   gd.horizontalSpan = span;
   form.setLayoutData(gd);
   return form;
 }
Exemplo n.º 7
0
  public Composite createViewer(Composite parent) throws ApplicationException {

    container = createContainer(parent);
    filterText = createSerchBar();
    viewForm = createViewForm();
    toolBarManager = createToolBar();
    tableViewer = createTableViewer();

    if ((gridStyle & IGridViewer.NoToolBar) == 0) viewForm.setTopLeft(toolBarManager.getControl());
    viewForm.setContent(tableViewer.getControl());
    container.addDisposeListener(
        new DisposeListener() {
          public void widgetDisposed(DisposeEvent e) {
            selection = beforeDispose();
          }
        });
    if (data != null) {
      setData(data);
    }
    return container;
  }
  public void createRenderingViewPane(final String paneId) {
    final RenderingViewPane renderingPane = new RenderingViewPane(this);
    fViewPanes.put(paneId, renderingPane);
    ViewForm renderingViewForm = new ViewForm(fSashForm, SWT.NONE);
    fViewPaneControls.put(paneId, renderingViewForm);
    fWeights.add(Integer.valueOf(40));

    Control renderingControl =
        renderingPane.createViewPane(
            renderingViewForm, paneId, DebugUIMessages.MemoryView_Memory_renderings, true, true);
    PlatformUI.getWorkbench()
        .getHelpSystem()
        .setHelp(
            renderingControl, IDebugUIConstants.PLUGIN_ID + ".MemoryView_context"); // $NON-NLS-1$
    renderingViewForm.setContent(renderingControl);

    Listener renderingActivateListener = createActivateListener(renderingPane);
    renderingControl.addListener(SWT.Activate, renderingActivateListener);

    Listener renderingDeactivateListener = createDeactivateListener(renderingPane);
    renderingControl.addListener(SWT.Deactivate, renderingDeactivateListener);
  }
Exemplo n.º 9
0
 public String clearAll(boolean validation) {
   if (tableViewer.getTable() != null) {
     // validate values;
     String errorMessage = clearEditors(validation);
     if (errorMessage != null) return errorMessage;
     columnNames = null;
     columnTitles = null;
     cellEditors = null;
     data = null;
     isColumnPacked = false;
     tableViewer.getTable().dispose();
     viewForm.dispose();
     container.dispose();
   }
   return null;
 }
Exemplo n.º 10
0
  /* (non-Javadoc)
   * @see org.eclipse.ui.IPresentationPreview#createControl(org.eclipse.swt.widgets.Composite, org.eclipse.ui.themes.ITheme)
   */
  public void createControl(Composite parent, ITheme currentTheme) {
    this.theme = currentTheme;
    folder = new CTabFolder(parent, SWT.BORDER);
    folder.setUnselectedCloseVisible(false);
    folder.setEnabled(false);
    folder.setMaximizeVisible(true);
    folder.setMinimizeVisible(true);

    viewForm = new ViewForm(folder, SWT.NONE);
    viewForm.marginHeight = 0;
    viewForm.marginWidth = 0;
    viewForm.verticalSpacing = 0;
    viewForm.setBorderVisible(false);
    toolBar = new ToolBar(viewForm, SWT.FLAT | SWT.WRAP);
    ToolItem toolItem = new ToolItem(toolBar, SWT.PUSH);

    Image hoverImage = WorkbenchImages.getImage(IWorkbenchGraphicConstants.IMG_LCL_VIEW_MENU);
    toolItem.setImage(hoverImage);

    viewForm.setTopRight(toolBar);

    viewMessage = new CLabel(viewForm, SWT.NONE);
    viewMessage.setText("Etu?"); // $NON-NLS-1$
    viewForm.setTopLeft(viewMessage);

    CTabItem item = new CTabItem(folder, SWT.CLOSE);
    item.setText("Lorem"); // $NON-NLS-1$
    Label text = new Label(viewForm, SWT.NONE);
    viewForm.setContent(text);
    text.setText("Lorem ipsum dolor sit amet"); // $NON-NLS-1$
    text.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WHITE));
    item = new CTabItem(folder, SWT.CLOSE);
    item.setText("Ipsum"); // $NON-NLS-1$
    item.setControl(viewForm);
    item.setImage(WorkbenchImages.getImage(ISharedImages.IMG_TOOL_COPY));

    folder.setSelection(item);

    item = new CTabItem(folder, SWT.CLOSE);
    item.setText("Dolor"); // $NON-NLS-1$
    item = new CTabItem(folder, SWT.CLOSE);
    item.setText("Sit"); // $NON-NLS-1$

    currentTheme.addPropertyChangeListener(fontAndColorListener);
    setColorsAndFonts();
    setTabPosition();
    setTabStyle();
  }
  public GrapheChargesIHM(final ViewForm parent) {
    super(parent, SWT.H_SCROLL | SWT.V_SCROLL);
    this.parent = parent;
    // this.setLayout(new FillLayout(SWT.VERTICAL));
    this.setSize(parent.getSize());
    canvas = new Canvas(this, SWT.NONE);
    reglerTaille();
    Menu menu = new Menu(parent.getShell(), SWT.POP_UP);
    MenuItem vueNormale = new MenuItem(menu, SWT.NONE);
    vueNormale.setText(message.getString("vueNormale"));
    vueNormale.addListener(
        SWT.Selection,
        new Listener() {
          public void handleEvent(Event e) {
            vueSuperposee = false;
            canvas.redraw();
          }
        });

    new MenuItem(menu, SWT.SEPARATOR);

    MenuItem vueSuper = new MenuItem(menu, SWT.NONE);
    vueSuper.setText(message.getString("vueSuperposee"));
    vueSuper.addListener(
        SWT.Selection,
        new Listener() {
          public void handleEvent(Event e) {
            vueSuperposee = true;
            canvas.redraw();
          }
        });

    canvas.setMenu(menu);

    final ScrollBar hBar = this.getHorizontalBar();
    hBar.addListener(
        SWT.Selection,
        new Listener() {
          public void handleEvent(Event e) {
            Point location = canvas.getLocation();
            location.x = -hBar.getSelection();
            canvas.setLocation(location);
            canvas.redraw();
          }
        });

    final ScrollBar vBar = this.getVerticalBar();
    vBar.addListener(
        SWT.Selection,
        new Listener() {
          public void handleEvent(Event e) {
            Point location = canvas.getLocation();
            location.y = -vBar.getSelection();
            canvas.setLocation(location);
            canvas.redraw();
          }
        });

    addListener(
        SWT.Resize,
        new Listener() {
          public void handleEvent(Event event) {
            reglerTaille();

            Point size = canvas.getSize();
            Rectangle rect = getClientArea();
            hBar.setMaximum(size.x);
            hBar.setThumb(Math.min(size.x, rect.width));
            vBar.setMaximum(size.y);
            vBar.setThumb(Math.min(size.y, rect.height));
            int vPage = size.y - rect.height;
            int hSelection = hBar.getSelection();
            Point location = canvas.getLocation();
            if (hSelection >= vPage) {
              if (vPage <= 0) hSelection = 0;
              location.x = -hSelection;
            }
            int vSelection = vBar.getSelection();
            if (vSelection >= vPage) {
              if (vPage <= 0) vSelection = 0;
              location.y = -vSelection;
            }
            canvas.setLocation(location);
          }
        });

    canvas.addMouseMoveListener(
        new MouseMoveListener() {
          public void mouseMove(MouseEvent e) {
            ActiviteGraphique actGraph = getAct(e.x, e.y);
            if (actGraph != null) {
              // EugesActRealise act = actGraph.getActiviteRealise();
            }
          }
        });

    canvas.addPaintListener(
        new PaintListener() {
          public void paintControl(PaintEvent e) {
            reglerTaille();
            GC gc = e.gc;
            Point p = canvas.getSize();
            // axe vertical
            gc.drawLine(20, 30, 20, p.y - 10);
            // fleche
            gc.drawLine(15, 35, 20, 30);
            gc.drawLine(20, 30, 25, 35);
            // graduations
            for (int i = 0; i < p.y - 60; i += 20) {
              gc.drawLine(15, p.y - 20 - i, 25, p.y - 20 - i);
              gc.drawString(Integer.toString(i / 10), 5, p.y - 20 - i - 5);
            }

            // axe horizontal
            gc.drawLine(10, p.y - 20, p.x - 10, p.y - 20);
            // fleche
            gc.drawLine(p.x - 10, p.y - 20, p.x - 15, p.y - 25);
            gc.drawLine(p.x - 10, p.y - 20, p.x - 15, p.y - 15);

            // legende
            Color blue = e.widget.getDisplay().getSystemColor(SWT.COLOR_BLUE);
            Color red = e.widget.getDisplay().getSystemColor(SWT.COLOR_RED);
            Color black = e.widget.getDisplay().getSystemColor(SWT.COLOR_BLACK);
            Color green = e.widget.getDisplay().getSystemColor(SWT.COLOR_GREEN);

            gc.setForeground(blue);
            gc.drawString(message.getString("chargesEstimees"), 0, 0);
            gc.setForeground(red);
            gc.drawString(message.getString("chargesReelles"), 0, 15);
            gc.setForeground(black);
            gc.drawString(message.getString("activites"), p.x - 50, p.y - 15);
            if (EugesElements._projet != null) {
              // si la vue superposee n'est pas choisie
              if (!vueSuperposee) {
                rectActivites.clear();
                // graduations axe horizontal
                for (int i = 0; i < p.x - 40; i += 100)
                  gc.drawLine(20 + i, p.y - 15, 20 + i, p.y - 25);
                // affichage des charges
                int nbact = 0;
                for (Iterator it = EugesElements._projet.get_listeIteration().iterator();
                    it.hasNext(); ) {
                  Iteration itTemp = (Iteration) it.next();
                  for (int i = 0; i < itTemp.getActiviteCount(); i++) {
                    EugesActRealise actTemp = itTemp.getActivite(i);
                    nbact++;
                    int chargeEstimee = actTemp.get_chargeEstimee();
                    int chargeReelle = actTemp.get_chargeReelle();
                    int[] dessus1 = {
                      ((nbact) * 100) - 30,
                      p.y - 20 - (chargeEstimee * 10),
                      ((nbact) * 100) - 15,
                      p.y - 35 - (chargeEstimee * 10),
                      ((nbact) * 100) + 35,
                      p.y - 35 - (chargeEstimee * 10),
                      ((nbact) * 100) + 20,
                      p.y - 20 - (chargeEstimee * 10)
                    };
                    int[] cote1 = {
                      ((nbact) * 100) + 20,
                      p.y - 20,
                      ((nbact) * 100) + 20,
                      p.y - 20 - (chargeEstimee * 10),
                      ((nbact) * 100) + 35,
                      p.y - 35 - (chargeEstimee * 10),
                      ((nbact) * 100) + 35,
                      p.y - 35
                    };
                    int[] dessus2 = {
                      ((nbact) * 100) + 20,
                      p.y - 20 - (chargeReelle * 10),
                      ((nbact) * 100) + 35,
                      p.y - 35 - (chargeReelle * 10),
                      ((nbact) * 100) + 85,
                      p.y - 35 - (chargeReelle * 10),
                      ((nbact) * 100) + 70,
                      p.y - 20 - (chargeReelle * 10)
                    };
                    int[] cote2 = {
                      ((nbact) * 100) + 70,
                      p.y - 20,
                      ((nbact) * 100) + 70,
                      p.y - 20 - (chargeReelle * 10),
                      ((nbact) * 100) + 85,
                      p.y - 35 - (chargeReelle * 10),
                      ((nbact) * 100) + 85,
                      p.y - 35
                    };
                    ActiviteGraphique estimee =
                        new ActiviteGraphique(
                            actTemp,
                            new Rectangle(
                                ((nbact) * 100) - 30,
                                p.y - 20 - (chargeEstimee * 10),
                                50,
                                chargeEstimee * 10),
                            dessus1,
                            cote1);
                    ActiviteGraphique reelle =
                        new ActiviteGraphique(
                            actTemp,
                            new Rectangle(
                                ((nbact) * 100) + 20,
                                p.y - 20 - (chargeReelle * 10),
                                50,
                                chargeReelle * 10),
                            dessus2,
                            cote2);
                    rectActivites.add(estimee);
                    rectActivites.add(reelle);
                    // rectangle charge estimée
                    gc.setBackground(blue);
                    gc.fillRectangle(
                        ((nbact) * 100) - 30,
                        p.y - 20 - (chargeEstimee * 10),
                        50,
                        chargeEstimee * 10);
                    gc.fillPolygon(dessus1);
                    gc.fillPolygon(cote1);
                    gc.setForeground(black);
                    gc.drawRectangle(
                        ((nbact) * 100) - 30,
                        p.y - 20 - (chargeEstimee * 10),
                        50,
                        chargeEstimee * 10);
                    gc.drawPolygon(dessus1);
                    gc.drawPolygon(cote1);
                    gc.drawString(
                        Integer.toString(chargeEstimee),
                        ((nbact) * 100) - 25,
                        p.y - 15 - (chargeEstimee * 10));

                    // rectangle charge réelle
                    gc.setBackground(red);
                    gc.fillRectangle(
                        ((nbact) * 100) + 20,
                        p.y - 20 - (chargeReelle * 10),
                        50,
                        chargeReelle * 10);
                    gc.fillPolygon(dessus2);
                    gc.fillPolygon(cote2);
                    gc.setForeground(black);
                    gc.drawRectangle(
                        ((nbact) * 100) + 20,
                        p.y - 20 - (chargeReelle * 10),
                        50,
                        chargeReelle * 10);
                    gc.drawPolygon(dessus2);
                    gc.drawPolygon(cote2);
                    gc.drawString(
                        Integer.toString(chargeReelle),
                        ((nbact) * 100) + 25,
                        p.y - 15 - (chargeReelle * 10));
                  }
                  nbact++;
                }
              } else {
                rectActivites.clear();
                // graduations axe horizontal
                for (int i = 0; i < p.x - 40; i += 50)
                  gc.drawLine(20 + i, p.y - 15, 20 + i, p.y - 25);
                // affichage des charges
                int nbact = 0;
                for (Iterator it = EugesElements._projet.get_listeIteration().iterator();
                    it.hasNext(); ) {
                  Iteration itTemp = (Iteration) it.next();
                  for (int i = 0; i < itTemp.getActiviteCount(); i++) {
                    EugesActRealise actTemp = itTemp.getActivite(i);
                    nbact++;
                    int chargeEstimee = actTemp.get_chargeEstimee();
                    int chargeReelle = actTemp.get_chargeReelle();
                    int[] dessus1 = {
                      ((nbact) * 50) + 20,
                      p.y - 20 - (chargeEstimee * 10),
                      ((nbact) * 50) + 35,
                      p.y - 35 - (chargeEstimee * 10),
                      ((nbact) * 50) + 85,
                      p.y - 35 - (chargeEstimee * 10),
                      ((nbact) * 50) + 70,
                      p.y - 20 - (chargeEstimee * 10)
                    };
                    int[] cote1 = {
                      ((nbact) * 50) + 70,
                      p.y - 20,
                      ((nbact) * 50) + 70,
                      p.y - 20 - (chargeEstimee * 10),
                      ((nbact) * 50) + 85,
                      p.y - 35 - (chargeEstimee * 10),
                      ((nbact) * 50) + 85,
                      p.y - 35
                    };

                    if (chargeReelle > chargeEstimee) {
                      int[] dessus2 = {
                        ((nbact) * 50) + 20,
                        p.y - 20 - (chargeReelle * 10),
                        ((nbact) * 50) + 35,
                        p.y - 35 - (chargeReelle * 10),
                        ((nbact) * 50) + 85,
                        p.y - 35 - (chargeReelle * 10),
                        ((nbact) * 50) + 70,
                        p.y - 20 - (chargeReelle * 10)
                      };
                      int[] cote2 = {
                        ((nbact) * 50) + 70,
                        p.y - 20,
                        ((nbact) * 50) + 70,
                        p.y - 20 - (chargeReelle * 10),
                        ((nbact) * 50) + 85,
                        p.y - 35 - (chargeReelle * 10),
                        ((nbact) * 50) + 85,
                        p.y - 35
                      };
                      ActiviteGraphique estimee =
                          new ActiviteGraphique(
                              actTemp,
                              new Rectangle(
                                  ((nbact) * 50) + 20,
                                  p.y - 20 - (chargeEstimee * 10),
                                  50,
                                  chargeEstimee * 10),
                              dessus1,
                              cote1);
                      ActiviteGraphique reelle =
                          new ActiviteGraphique(
                              actTemp,
                              new Rectangle(
                                  ((nbact) * 50) + 20,
                                  p.y - 20 - (chargeReelle * 10),
                                  50,
                                  chargeReelle * 10),
                              dessus2,
                              cote2);
                      rectActivites.add(estimee);
                      rectActivites.add(reelle);
                      // rectangle charge réelle
                      gc.setBackground(red);
                      gc.fillRectangle(
                          ((nbact) * 50) + 20,
                          p.y - 20 - (chargeReelle * 10),
                          50,
                          chargeReelle * 10);
                      gc.fillPolygon(dessus2);
                      gc.fillPolygon(dessus1);
                      gc.fillPolygon(cote2);
                      gc.setForeground(black);
                      gc.drawRectangle(
                          ((nbact) * 50) + 20,
                          p.y - 20 - (chargeReelle * 10),
                          50,
                          chargeReelle * 10);
                      gc.drawPolygon(dessus2);
                      gc.drawPolygon(cote2);
                      // rectangle charge estimée
                      gc.setBackground(blue);
                      gc.fillRectangle(
                          ((nbact) * 50) + 20,
                          p.y - 20 - (chargeEstimee * 10),
                          50,
                          chargeEstimee * 10);
                      gc.fillPolygon(cote1);
                      gc.setForeground(black);
                      gc.drawRectangle(
                          ((nbact) * 50) + 20,
                          p.y - 20 - (chargeEstimee * 10),
                          50,
                          chargeEstimee * 10);
                      // gc.drawPolygon(dessus1);
                      gc.drawPolygon(cote1);
                    } else {
                      int[] dessus2 = {
                        ((nbact) * 50) + 20,
                        p.y - 20 - (chargeReelle * 10),
                        ((nbact) * 50) + 35,
                        p.y - 35 - (chargeReelle * 10),
                        ((nbact) * 50) + 85,
                        p.y - 35 - (chargeReelle * 10),
                        ((nbact) * 50) + 70,
                        p.y - 20 - (chargeReelle * 10)
                      };
                      ActiviteGraphique estimee =
                          new ActiviteGraphique(
                              actTemp,
                              new Rectangle(
                                  ((nbact) * 50) + 20,
                                  p.y - 20 - (chargeEstimee * 10),
                                  50,
                                  chargeEstimee * 10),
                              dessus1,
                              cote1);
                      ActiviteGraphique reelle =
                          new ActiviteGraphique(
                              actTemp,
                              new Rectangle(
                                  ((nbact) * 50) + 20,
                                  p.y - 20 - (chargeReelle * 10),
                                  50,
                                  chargeReelle * 10),
                              dessus2,
                              cote1);
                      rectActivites.add(estimee);
                      rectActivites.add(reelle);
                      // rectangle charge estimée
                      gc.setBackground(blue);
                      gc.fillRectangle(
                          ((nbact) * 50) + 20,
                          p.y - 20 - (chargeEstimee * 10),
                          50,
                          chargeEstimee * 10);
                      gc.fillPolygon(cote1);
                      gc.fillPolygon(dessus1);
                      gc.setBackground(green);
                      gc.fillPolygon(dessus2);
                      gc.setForeground(black);
                      gc.drawPolygon(dessus2);
                      gc.setForeground(black);
                      gc.drawRectangle(
                          ((nbact) * 50) + 20,
                          p.y - 20 - (chargeEstimee * 10),
                          50,
                          chargeEstimee * 10);
                      gc.drawPolygon(dessus1);
                      gc.drawPolygon(cote1);
                    }
                  }
                  nbact++;
                }
              }
            }
          }
        });
    canvas.redraw();
  }
  /* (non-Javadoc)
   * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
   */
  @Override
  protected Control createDialogArea(Composite theParent) {
    originalLanguageObjLabel =
        WidgetFactory.createLabel(theParent, CoreStringUtil.Constants.EMPTY_STRING);
    Composite pnlContents = (Composite) super.createDialogArea(theParent);

    //
    // main panel contents
    //

    CTabFolder tabFolder = WidgetFactory.createTabFolder(pnlContents);

    //
    // tabFolder contents - 2 tabs (Tree, SQL Text), each with a splitter
    //

    CTabItem treeTab =
        WidgetFactory.createTab(tabFolder, Util.getString(PREFIX + "treeTab")); // $NON-NLS-1$
    treeTab.setToolTipText(Util.getString(PREFIX + "treeTab.tip")); // $NON-NLS-1$

    SashForm treeTabSash = new SashForm(tabFolder, SWT.VERTICAL);
    treeTabSash.setLayoutData(new GridData(GridData.FILL_BOTH));
    treeTab.setControl(treeTabSash);

    CTabItem sqlTab =
        WidgetFactory.createTab(tabFolder, Util.getString(PREFIX + "sqlTab")); // $NON-NLS-1$
    sqlTab.setToolTipText(Util.getString(PREFIX + "sqlTab.tip")); // $NON-NLS-1$

    SashForm sqlTabSash = new SashForm(tabFolder, SWT.VERTICAL);
    sqlTabSash.setLayoutData(new GridData(GridData.FILL_BOTH));
    sqlTab.setControl(sqlTabSash);

    //
    // treeTab contents
    //

    ViewForm formTree = new ViewForm(treeTabSash, SWT.BORDER);
    Composite pnlTree = new Composite(formTree, SWT.NO_TRIM);
    formTree.setContent(pnlTree);
    GridLayout layout = new GridLayout();
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    pnlTree.setLayout(layout);
    pnlTree.setLayoutData(new GridData(GridData.FILL_BOTH));

    ViewForm formEditor = new ViewForm(treeTabSash, SWT.BORDER);
    pnlEditor = new Composite(formEditor, SWT.NO_TRIM);
    formEditor.setContent(pnlEditor);
    pnlEditor.setLayoutData(new GridData(GridData.FILL_BOTH));

    lblTitle = new Label(formEditor, SWT.CENTER);
    lblTitle.setBackground(BuilderUtils.COLOR_HIGHLIGHT);
    formEditor.setTopLeft(lblTitle);

    treeTabSash.setWeights(new int[] {30, 70});

    //
    // sqlTab contents
    //

    ViewForm formCurrentSql = new ViewForm(sqlTabSash, SWT.BORDER);
    ViewForm formOriginalSql = new ViewForm(sqlTabSash, SWT.BORDER);

    //
    // formCurrentSql contents
    //

    Composite pnlCurrentSql = new Composite(formCurrentSql, SWT.NONE);
    formCurrentSql.setContent(pnlCurrentSql);
    pnlCurrentSql.setLayout(new GridLayout());
    pnlCurrentSql.setLayoutData(new GridData(GridData.FILL_BOTH));

    currentSql = new SqlDisplayPanel(pnlCurrentSql);
    currentSql.setLayoutData(new GridData(GridData.FILL_BOTH));

    CLabel lblCurrent = new CLabel(formCurrentSql, SWT.NONE);
    lblCurrent.setBackground(BuilderUtils.COLOR_HIGHLIGHT);
    lblCurrent.setText(Util.getString(PREFIX + "lblCurrent")); // $NON-NLS-1$
    lblCurrent.setToolTipText(Util.getString(PREFIX + "lblCurrent.tip")); // $NON-NLS-1$
    formCurrentSql.setTopLeft(lblCurrent);

    //
    // formOriginalSql contents
    //

    Composite pnlOriginalSql = new Composite(formOriginalSql, SWT.NONE);
    formOriginalSql.setContent(pnlOriginalSql);
    pnlOriginalSql.setLayout(new GridLayout());
    pnlOriginalSql.setLayoutData(new GridData(GridData.FILL_BOTH));

    originalSql = new SqlDisplayPanel(pnlOriginalSql);
    originalSql.setLayoutData(new GridData(GridData.FILL_BOTH));

    CLabel lblOriginal = new CLabel(formOriginalSql, SWT.NONE);
    lblOriginal.setBackground(BuilderUtils.COLOR_HIGHLIGHT);
    lblOriginal.setText(Util.getString(PREFIX + "lblOriginal")); // $NON-NLS-1$
    lblOriginal.setToolTipText(Util.getString(PREFIX + "lblOriginal.tip")); // $NON-NLS-1$
    formOriginalSql.setTopLeft(lblOriginal);

    //
    // pnlTree contents - 2 columns (tree viewer, button panel)
    //

    layout = new GridLayout();
    layout.numColumns = 2;
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    pnlTree.setLayout(layout);

    treeViewer = new LanguageObjectBuilderTreeViewer(pnlTree);
    treeViewer.addSelectionChangedListener(
        new ISelectionChangedListener() {
          @Override
          public void selectionChanged(SelectionChangedEvent theEvent) {
            handleTreeSelection();
          }
        });

    MenuManager menuMgr = new MenuManager();
    menuMgr.setRemoveAllWhenShown(true);
    menuMgr.addMenuListener(
        new IMenuListener() {
          @Override
          public void menuAboutToShow(IMenuManager theMenuMgr) {
            fillContextMenu(theMenuMgr);
          }
        });
    treeViewer.getTree().setMenu(menuMgr.createContextMenu(treeViewer.getTree()));

    Composite pnlButtons = new Composite(pnlTree, SWT.NONE);
    pnlButtons.setLayout(new GridLayout());

    createTreeButtons(pnlButtons);

    //
    // pnlEditor contents
    //

    layout = new GridLayout();
    layout.numColumns = 2;
    pnlEditor.setLayout(layout);

    pnlEditorDetail = new Composite(pnlEditor, SWT.NONE);
    pnlEditorDetail.setLayoutData(new GridData(GridData.FILL_BOTH));
    pnlEditorDetail.setLayout(new GridLayout());
    return pnlContents;
  }