Package org.eclipse.swt.custom

Examples of org.eclipse.swt.custom.ViewForm


     * @param parent the parent composite
     */
    public void createWidget( Composite parent )
    {

        control = new ViewForm( parent, SWT.NONE );
        // control.marginWidth = 0;
        // control.marginHeight = 0;
        // control.horizontalSpacing = 0;
        // control.verticalSpacing = 0;
        control.setLayoutData( new GridData( GridData.FILL_BOTH ) );
View Full Code Here


    /* (non-Javadoc)
     * @see org.eclipse.ltk.ui.refactoring.IChangePreviewViewer#createControl(org.eclipse.swt.widgets.Composite)
     */
    public void createControl(Composite parent)
    {
        control = new ViewForm(parent, SWT.NONE);
        text = new Label(control, SWT.NONE);
    }
View Full Code Here

  private void createControls() {
    setLayout(new GridLayout(2, false));
    setLayoutData(new GridData(GridData.FILL_BOTH));

    ViewForm viewerPane = new ViewForm(this, SWT.BORDER | SWT.FLAT);
    viewerPane.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));

        CLabel toolbarLabel = new CLabel(viewerPane, SWT.NONE) {
          public Point computeSize(int wHint, int hHint, boolean changed) {
            return super.computeSize(wHint, Math.max(24, hHint), changed);
          }
        };
 
      if (label != null) {
        toolbarLabel.setText(label);
      }
        viewerPane.setTopLeft(toolbarLabel);
   
      int buttonGroupColumns = 1;
      if (toolbarControlCreator != null) {
        buttonGroupColumns = buttonGroupColumns + toolbarControlCreator.getControlCount();
      }
   
    ToolBar toolbar = new ToolBar(viewerPane, SWT.FLAT);
   
    viewerPane.setTopCenter(toolbar);

    ToolBarManager toolbarManager = new ToolBarManager(toolbar);
   
    if (toolbarControlCreator != null) {
      toolbarControlCreator.createToolbarControls(toolbarManager);
      toolbarManager.add(new Separator());
    }

    flatAction = new Action(Policy.bind("ResourceSelectionTree.flat"), Action.AS_RADIO_BUTTON) {  //$NON-NLS-1$
      public void run() {
        mode = MODE_FLAT;
        settings.put(MODE_SETTING, MODE_FLAT);
        treeAction.setChecked(false);
        compressedAction.setChecked(false);
        refresh();
      }     
    };
    flatAction.setImageDescriptor(SVNUIPlugin.getPlugin().getImageDescriptor(ISVNUIConstants.IMG_AFFECTED_PATHS_FLAT_MODE));
    toolbarManager.add(flatAction);
    treeAction = new Action(Policy.bind("ResourceSelectionTree.tree"), Action.AS_RADIO_BUTTON) {  //$NON-NLS-1$
      public void run() {
        mode = MODE_TREE;
        settings.put(MODE_SETTING, MODE_TREE);
        flatAction.setChecked(false);
        compressedAction.setChecked(false);
        refresh();
      }         
    };
    treeAction.setImageDescriptor(SVNUIPlugin.getPlugin().getImageDescriptor(ISVNUIConstants.IMG_AFFECTED_PATHS_TREE_MODE));
    toolbarManager.add(treeAction);
   
    compressedAction = new Action(Policy.bind("ResourceSelectionTree.compressedFolders"), Action.AS_RADIO_BUTTON) {  //$NON-NLS-1$
      public void run() {
        mode = MODE_COMPRESSED_FOLDERS;
        settings.put(MODE_SETTING, MODE_COMPRESSED_FOLDERS);
        treeAction.setChecked(false);
        flatAction.setChecked(false);
        refresh();
      }         
    };
    compressedAction.setImageDescriptor(SVNUIPlugin.getPlugin().getImageDescriptor(ISVNUIConstants.IMG_AFFECTED_PATHS_COMPRESSED_MODE));
    toolbarManager.add(compressedAction);
   
    toolbarManager.update(true);
   
    mode = MODE_COMPRESSED_FOLDERS;
    try {
      mode = settings.getInt(MODE_SETTING);
    } catch (Exception e) {}
    switch (mode) {
    case MODE_COMPRESSED_FOLDERS:
      compressedAction.setChecked(true);
      break;
    case MODE_FLAT:
      flatAction.setChecked(true);
      break;
    case MODE_TREE:
      treeAction.setChecked(true);
      break;     
    default:
      break;
    }

    if (checkbox) {
      treeViewer = new CheckboxTreeViewer(viewerPane, SWT.MULTI);
     
      // Override the spacebar behavior to toggle checked state for all selected items.
        treeViewer.getControl().addKeyListener(new KeyAdapter() {
            public void keyPressed(KeyEvent event) {
                if (event.keyCode == SPACEBAR) {
                  Tree tree = (Tree)treeViewer.getControl();
                  TreeItem[] items = tree.getSelection();
                  for (int i = 0; i < items.length; i++) {
                    if (i > 0) items[i].setChecked(!items[i].getChecked());
                  }
                }
            }
        });     
      } else {
        treeViewer = new TreeViewer(viewerPane, SWT.MULTI);
      }
    tree = treeViewer.getTree();
    tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    viewerPane.setContent(tree);
   
    if (labelProvider == null) {
      labelProvider = new ResourceSelectionLabelProvider();
    }
   
View Full Code Here

            IResource[] resources, IToolbarControlCreator toolbarControlCreator) {
        super(parent, style);
        setLayout(new GridLayout(2, false));
        setLayoutData(new GridData(GridData.FILL_BOTH));

        ViewForm viewerPane = new ViewForm(this, SWT.BORDER | SWT.FLAT);
        viewerPane.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
        CLabel toolbarLabel = new CLabel(viewerPane, SWT.NONE) {
            public Point computeSize(int wHint, int hHint, boolean changed) {
                return super.computeSize(wHint, Math.max(24, hHint), changed);
            }
        };
        if (label != null) {
            toolbarLabel.setText(label);
        }
        viewerPane.setTopLeft(toolbarLabel);

        int buttonGroupColumns = 1;
        if (toolbarControlCreator != null) {
            buttonGroupColumns = buttonGroupColumns + toolbarControlCreator.getControlCount();
        }
        ToolBar toolbar = new ToolBar(viewerPane, SWT.FLAT);
        viewerPane.setTopCenter(toolbar);

        ToolBarManager toolbarManager = new ToolBarManager(toolbar);

        if (toolbarControlCreator != null) {
            toolbarControlCreator.createToolbarControls(toolbarManager);
            toolbarManager.add(new Separator());
        }

        toolbarManager.update(true);

        resourceList = new ArrayList<IResource>();

        if (resources != null) {
            Arrays.sort(resources, comparator);
            for (int i = 0; i < resources.length; i++) {
                IResource resource = resources[i];
                try {
                    ISVNLocalResource svnResource = SVNWorkspaceRoot.getSVNResourceFor(resource);
                    if (svnResource.getStatus().isManaged()) {
                        resourceList.add(resource);
                    }
                } catch (SVNException e) {
                }
            }
        }

        tableViewer = CheckboxTableViewer.newCheckList(viewerPane, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
        GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
        gd.heightHint = 125;
        tableViewer.getControl().setLayoutData(gd);
        table = tableViewer.getTable();

        final TableColumn newColumnTableColumn = new TableColumn(table, SWT.NONE);
        newColumnTableColumn.setWidth(740);
        newColumnTableColumn.setText("Resources for Generate Diff of Post-commit");

        table.setHeaderVisible(true);// 显示表头
        table.setLinesVisible(true);// 显示表格线
        TableLayout tLayOut = new TableLayout();// 专用于表格的布局
        table.setLayout(tLayOut);
        table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

        tLayOut.addColumnData(new ColumnWeightData(740));// ID列宽

        tableViewer.setContentProvider(new TableViewerContentProvider());
        tableViewer.setLabelProvider(new ResourceTableViewerLabelProvider());
        tableViewer.setInput(resourceList);

        viewerPane.setContent(table);

    }
View Full Code Here

            layout.marginWidth = 0;
            layout.marginHeight = 0;
            layout.verticalSpacing = 0;
            composite.setLayout( layout );

            control = new ViewForm( composite, SWT.NONE );
            control.setLayoutData( new GridData( GridData.FILL_BOTH ) );

            Composite browserConnectionWidgetControl = BaseWidgetUtils.createColumnContainer( control, 2, 1 );
            browserConnectionWidget = new BrowserConnectionWidget();
            browserConnectionWidget.createWidget( browserConnectionWidgetControl );
View Full Code Here

     *            the parent component
     * @param style
     *            SWT style bits
     */
    public DetailsContentViewer(Composite parent, int style) {
      viewForm = new ViewForm(parent, style);
      GridData gd = new GridData(GridData.FILL_HORIZONTAL);
      gd.horizontalSpan = 2;
      viewForm.setLayoutData(gd);
      label = new CLabel(viewForm, SWT.FLAT);
      label.setFont(parent.getFont());
View Full Code Here

     * @param parent the parent composite
     */
    public void createWidget( Composite parent )
    {

        control = new ViewForm( parent, SWT.NONE );
        // control.marginWidth = 0;
        // control.marginHeight = 0;
        // control.horizontalSpacing = 0;
        // control.verticalSpacing = 0;
        control.setLayoutData( new GridData( GridData.FILL_BOTH ) );
View Full Code Here

    }
    /*
     * Set up w/ an embeded brower.
     */
    public void createDisplay( Composite parent ) {
        viewForm= new ViewForm( parent, SWT.NONE);
       
        //label= new CLabel( viewForm, SWT.NONE);
        //viewForm.setTopLeft( label );
       
        ToolBar toolBar= new ToolBar( viewForm, SWT.FLAT | SWT.WRAP);
View Full Code Here

  private void createContent() {

    this.uiThread = Thread.currentThread();

    viewForm = new ViewForm(this, SWT.NONE);
    viewForm.setLayout(new FillLayout());

    Composite infoComposite = createCompositeLegend(viewForm);
    viewForm.setTopLeft(infoComposite);
View Full Code Here

     */
    private void createContent() {

        this.setLayout(new FillLayout());

        viewForm = new ViewForm(this, SWT.NONE);
        viewForm.setLayout(new FillLayout());

        infoComposite = new Composite(viewForm, SWT.NONE);

        createCompositeInformation();
View Full Code Here

TOP

Related Classes of org.eclipse.swt.custom.ViewForm

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.