コード例 #1
0
 public void createContents(Composite parent) {
   shell = parent.getShell();
   parent.setLayout(new FillLayout());
   folder = new TabFolder(shell, SWT.BORDER);
   labelTab();
   directoryDialogTab();
   buttonTab();
   sliderTab();
   scribbleTab();
   browserTab();
 }
コード例 #2
0
 public static void sliderTab() {
   TabItem tab = new TabItem(folder, SWT.CLOSE);
   tab.setText("Sliders and Progress bars");
   tab.setToolTipText("Tied Slider to ProgressBar");
   Composite composite = new Composite(folder, SWT.NONE);
   composite.setLayout(new GridLayout(2, true));
   final Slider slider = new Slider(composite, SWT.HORIZONTAL);
   final ProgressBar progress = new ProgressBar(composite, SWT.HORIZONTAL);
   slider.addSelectionListener(
       new SelectionAdapter() {
         public void widgetSelected(SelectionEvent event) {
           progress.setSelection(slider.getSelection());
         }
       });
   tab.setControl(composite);
 }
コード例 #3
0
 public static void buttonTab() {
   TabItem tab = new TabItem(folder, SWT.CLOSE);
   tab.setText("Buttons");
   tab.setToolTipText("Different kinds of Buttons");
   Composite composite = new Composite(folder, SWT.NONE);
   composite.setLayout(new GridLayout(4, true));
   for (int dir : new int[] {SWT.UP, SWT.RIGHT, SWT.LEFT, SWT.DOWN}) {
     Button b = new Button(composite, SWT.ARROW | dir);
     b.addListener(SWT.MouseDown, listener);
   }
   newButton(composite, SWT.CHECK, "Check button");
   newButton(composite, SWT.PUSH, "Push button");
   newButton(composite, SWT.RADIO, "Radio button");
   newButton(composite, SWT.TOGGLE, "Toggle button");
   newButton(composite, SWT.FLAT, "Flat button");
   tab.setControl(composite);
 }