예제 #1
0
  private void createBranchesArea(Composite parent, FormToolkit toolkit, int span) {
    branchSection = createSection(parent, toolkit, span);
    Composite branchesArea = createSectionClient(branchSection, toolkit);

    branchViewer = new TableViewer(toolkit.createTable(branchesArea, SWT.V_SCROLL | SWT.H_SCROLL));
    GridDataFactory.fillDefaults()
        .grab(true, true)
        .hint(SWT.DEFAULT, 50)
        .applyTo(branchViewer.getControl());
    branchViewer.setSorter(new ViewerSorter());
    branchViewer.setLabelProvider(
        new GitLabelProvider() {

          public String getText(Object element) {
            return Repository.shortenRefName(super.getText(element));
          }
        });
    branchViewer.setContentProvider(ArrayContentProvider.getInstance());
    branchViewer.getTable().setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TREE_BORDER);

    fillBranches();

    updateSectionClient(branchSection, branchesArea, toolkit);
  }
예제 #2
0
 /** Refresh the editor page */
 public void refresh() {
   fillTags(tagLabelArea.getParent(), getManagedForm().getToolkit());
   fillBranches();
   getManagedForm().getForm().layout(true, true);
 }