Package org.eclipse.swt.custom

Examples of org.eclipse.swt.custom.SashForm


    formData.left = new FormAttachment(0,0);
    formData.right = new FormAttachment(100,0);
    formData.top = new FormAttachment(0,0);
    lHeaderText.setLayoutData(formData);
   
    SashForm sash = new SashForm(updateWindow,SWT.VERTICAL);
      
    table = new Table(sash,SWT.CHECK | SWT.BORDER | SWT.SINGLE | SWT.FULL_SELECTION);
    String[] names = {"name" , "version" , "size"};
    int[] sizes = {350,100,100};
    for(int i = 0 ; i < names.length ; i++) {
      TableColumn column = new TableColumn(table, i == 0 ? SWT.LEFT : SWT.RIGHT);
      Messages.setLanguageText(column,"UpdateWindow.columns." + names[i]);
      column.setWidth(sizes[i]);
    }
    table.setHeaderVisible(true);   

    table.addListener(SWT.Selection,new Listener() {
      public void handleEvent(Event e) {
        rowSelected();
      }
    });
   
    Composite cInfoArea = new Composite(sash, SWT.NONE);
    cInfoArea.setLayout(new FormLayout());
   
    link_area = new LinkArea(cInfoArea);
    FormData fd = new FormData();
    fd.top = new FormAttachment(0, 0);
    fd.bottom = new FormAttachment(100, 0);
    fd.right = new FormAttachment(100, 0);
    fd.left = new FormAttachment(0, 0);
    link_area.getComponent().setLayoutData(fd);
   
    try {
      browser = Utils.createSafeBrowser(cInfoArea, SWT.BORDER);
      if (browser != null) {
        fd = new FormData();
        fd.top = new FormAttachment(0, 0);
        fd.bottom = new FormAttachment(100, 0);
        fd.right = new FormAttachment(100, 0);
        fd.left = new FormAttachment(0, 0);
        browser.setLayoutData(fd);
      }
    } catch (Throwable t) {
    }

    progress = new ProgressBar(updateWindow,SWT.NULL);
    progress.setMinimum(0);
    progress.setMaximum(100);
    progress.setSelection(0);
   
    status = new Label(updateWindow,SWT.NULL);
   
    Composite cButtons = new Composite(updateWindow, SWT.NONE);
    FillLayout fl = new FillLayout(SWT.HORIZONTAL);
    fl.spacing = 3;
    cButtons.setLayout(fl);
   
    btnOk = new Button(cButtons,SWT.PUSH);
    Messages.setLanguageText(btnOk,res_prefix + ".ok" );
   
    updateWindow.setDefaultButton( btnOk );
    lOk = new Listener() {
      public void handleEvent(Event e) {
        update();
      }
    };
   
    btnOk.addListener(SWT.Selection, lOk);
    btnOk.setEnabled( false );
   
    btnCancel = new Button(cButtons,SWT.PUSH);
   
    Messages.setLanguageText(btnCancel,"UpdateWindow.cancel");
   
    lCancel = new Listener() {
        public void handleEvent(Event e) {
          dispose();
           check_instance.cancel();
        }
     };
    btnCancel.addListener(SWT.Selection,lCancel);
   
    updateWindow.addListener(SWT.Traverse, new Listener() { 
    public void handleEvent(Event e) {
      if ( e.character == SWT.ESC){
            dispose();
            check_instance.cancel();     
       }
    }
    });
   
    formData = new FormData();
    formData.left = new FormAttachment(0,0);
    formData.right = new FormAttachment(100,0);
    formData.top = new FormAttachment(lHeaderText);
    formData.bottom = new FormAttachment(progress);
    sash.setLayoutData(formData);
   
    formData = new FormData();
    formData.left = new FormAttachment(0,0);
    formData.right = new FormAttachment(100,0);
    formData.bottom = new FormAttachment(status);
    progress.setLayoutData(formData);
   
    formData = new FormData();
    formData.left = new FormAttachment(0,0);
    formData.right = new FormAttachment(100,0);
    formData.bottom = new FormAttachment(cButtons);
    status.setLayoutData(formData);
   
    formData = new FormData();
    formData.right = new FormAttachment(100,0);
    formData.bottom = new FormAttachment(100,0);
    cButtons.setLayoutData(formData);
   
    sash.setWeights(new int[] { 25, 75 });
   
    updateWindow.setSize(600,450);
    //updateWindow.open();
  }
View Full Code Here


    */
    try {
      Display d = composite.getDisplay();
      GridLayout configLayout;
 
      SashForm form = new SashForm(cConfig,SWT.HORIZONTAL);
      gridData = new GridData(GridData.FILL_BOTH);
      form.setLayoutData(gridData);
     
      Composite cLeftSide = new Composite(form, SWT.BORDER);
      gridData = new GridData(GridData.FILL_BOTH);
      cLeftSide.setLayoutData(gridData);
     
      FormLayout layout = new FormLayout();
      cLeftSide.setLayout(layout);
     
      Composite cFilterArea = new Composite(cLeftSide, SWT.NONE);
      cFilterArea.setLayout(new FormLayout());
     
      final Text txtFilter = new Text(cFilterArea, SWT.BORDER);
      final String sFilterText = MessageText.getString("ConfigView.filter");
      txtFilter.setText(sFilterText);
      txtFilter.selectAll();
      txtFilter.addModifyListener(new ModifyListener() {
        public void modifyText(ModifyEvent e) {
          filterTree(txtFilter.getText());
        }
      });
      txtFilter.addMouseListener(new MouseAdapter() {
        public void mouseDown(MouseEvent e) {
          if (txtFilter.getText().equals(sFilterText)) {
            txtFilter.selectAll();
          }
        }
      });
      txtFilter.setFocus();
     
      ImageLoader imageLoader = ImageLoader.getInstance();
      imgSmallXGray = imageLoader.getImage("smallx-gray");
      imgSmallX = imageLoader.getImage("smallx");

      lblX = new Label(cFilterArea, SWT.WRAP);
      Messages.setLanguageTooltip(lblX, "MyTorrentsView.clearFilter.tooltip");
      lblX.setImage(imgSmallXGray);
      lblX.addMouseListener(new MouseAdapter() {
        public void mouseUp(MouseEvent e) {
          txtFilter.setText("");
        }
      });
     
      lblX.addDisposeListener(new DisposeListener() {
        public void widgetDisposed(DisposeEvent arg0) {
          ImageLoader imageLoader = ImageLoader.getInstance();
          imageLoader.releaseImage("smallx-gray");
          imageLoader.releaseImage("smallx");
        }
      });
     
      Label lblSearch = new Label(cFilterArea, SWT.NONE);
      imageLoader.setLabelImage(lblSearch, "search");
 
      tree = new Tree(cLeftSide, SWT.NONE);
      FontData[] fontData = tree.getFont().getFontData();
      fontData[0].setStyle(SWT.BOLD);
      filterFoundFont = new Font(d, fontData);
     
      FormData formData;

      formData = new FormData();
      formData.bottom = new FormAttachment(100, -5);
      formData.left = new FormAttachment(0, 0);
      formData.right = new FormAttachment(100, 0);
      cFilterArea.setLayoutData(formData);
     
      formData = new FormData();
      formData.top = new FormAttachment(0,5);
      formData.left = new FormAttachment(0, 5);
      lblSearch.setLayoutData(formData);

      formData = new FormData();
      formData.top = new FormAttachment(0,5);
      formData.left = new FormAttachment(lblSearch,5);
      formData.right = new FormAttachment(lblX, -3);
      txtFilter.setLayoutData(formData);

      formData = new FormData();
      formData.top = new FormAttachment(0,5);
      formData.right = new FormAttachment(100,-5);
      lblX.setLayoutData(formData);

      formData = new FormData();
      formData.top = new FormAttachment(0, 0);
      formData.left = new FormAttachment(0,0);
      formData.right = new FormAttachment(100,0);
      formData.bottom = new FormAttachment(cFilterArea,-1);
      tree.setLayoutData(formData);
 
      Composite cRightSide = new Composite(form, SWT.NULL);
      configLayout = new GridLayout();
      configLayout.marginHeight = 3;
      configLayout.marginWidth = 0;
      cRightSide.setLayout(configLayout);
 
      // Header
      Composite cHeader = new Composite(cRightSide, SWT.BORDER);
      configLayout = new GridLayout();
      configLayout.marginHeight = 3;
      configLayout.marginWidth = 0;
      configLayout.numColumns = 2;
      configLayout.marginRight = 5;
      cHeader.setLayout(configLayout);
      gridData = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_CENTER);
      cHeader.setLayoutData(gridData);
 
      cHeader.setBackground(d.getSystemColor(SWT.COLOR_LIST_SELECTION));
      cHeader.setForeground(d.getSystemColor(SWT.COLOR_LIST_SELECTION_TEXT));
 
      lHeader = new Label(cHeader, SWT.NULL);
      lHeader.setBackground(d.getSystemColor(SWT.COLOR_LIST_SELECTION));
      lHeader.setForeground(d.getSystemColor(SWT.COLOR_LIST_SELECTION_TEXT));
      fontData = lHeader.getFont().getFontData();
      fontData[0].setStyle(SWT.BOLD);
      int fontHeight = (int)(fontData[0].getHeight() * 1.2);
      fontData[0].setHeight(fontHeight);
      headerFont = new Font(d, fontData);
      lHeader.setFont(headerFont);
      gridData = new GridData(GridData.VERTICAL_ALIGN_CENTER | GridData.HORIZONTAL_ALIGN_BEGINNING);
      lHeader.setLayoutData(gridData);
     
     
      usermodeHint = new Label(cHeader, SWT.NULL);
      usermodeHint.setBackground(d.getSystemColor(SWT.COLOR_LIST_SELECTION));
      usermodeHint.setForeground(d.getSystemColor(SWT.COLOR_LIST_SELECTION_TEXT));
      gridData = new GridData(GridData.VERTICAL_ALIGN_CENTER | GridData.HORIZONTAL_ALIGN_END | GridData.GRAB_HORIZONTAL);
      usermodeHint.setLayoutData(gridData);
 
      // Config Section
      cConfigSection = new Composite(cRightSide, SWT.NULL);
      layoutConfigSection = new StackLayout();
      cConfigSection.setLayout(layoutConfigSection);
      gridData = new GridData(GridData.FILL_BOTH);
      gridData.horizontalIndent = 2;
      cConfigSection.setLayoutData(gridData);
 
 
      form.setWeights(new int[] {20,80});
 
      tree.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent e) {
          Tree tree = (Tree)e.getSource();
          //Check that at least an item is selected
View Full Code Here

          sash.getParent().layout();
        }
      });
    } else {
      // Widgets exist, so use a SashForm to split them
      final SashForm sashForm = new SashForm(createOn, style);
      skinObject = new SWTSkinObjectContainer(this, properties, sashForm, sID,
          sConfigID, "sash", parentSkinObject);
      addToControlMap(skinObject);

      int iSashWidth = properties.getIntValue(sConfigID + ".sash.width", -1);
View Full Code Here

    /* Separate from SashForm */
    Label sep = new Label(rootComposite, SWT.SEPARATOR | SWT.HORIZONTAL);
    sep.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));

    /* SashForm dividing Feed and News View */
    fSashForm = new SashForm(rootComposite, (fInitialLayoutVertical ? SWT.VERTICAL : SWT.HORIZONTAL) | SWT.SMOOTH);
    fSashForm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    if (!fInitialLayoutVertical)
      fSashForm.setBackground(fSashForm.getDisplay().getSystemColor(SWT.COLOR_GRAY));

View Full Code Here

    return mMediaViewer;
  }

  public MediaTreeView createItemViewer(Composite pParent) {

    SashForm lItemSash = new SashForm(pParent, SWT.VERTICAL);
    GridData lData = new GridData(GridData.FILL_BOTH);
    lItemSash.setLayoutData(lData);

    mItemViewer = new MediaTreeView(lItemSash);

// CB TODO move
// mItemInfoView = new MediaItemView(lItemSash);
View Full Code Here

              children = container.getChildren();
              if (children.length > 2) {

                /* Sash and Tree */
                if (children[1] instanceof SashForm) {
                  SashForm form = (SashForm) children[1];
                  form.setWeights(new int[] { 70, 30 });

                  Control[] formChilds = form.getChildren();
                  if (formChilds.length != 0 && formChilds[0] instanceof Tree) {
                    Tree tree = (Tree) formChilds[0];
                    if (tree.getItemCount() != 0) {
                      TreeItem root = tree.getItem(0);
                      root.setExpanded(true);
View Full Code Here

    /* Title Message */
    setMessage("You can use \'?\' for any character and \'*\' for any word in your search.", IMessageProvider.INFORMATION);

    /* Sashform dividing search definition from results */
    SashForm sashForm = new SashForm(parent, SWT.VERTICAL | SWT.SMOOTH);
    sashForm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));

    /* Top Area */
    Composite topSash = new Composite(sashForm, SWT.NONE);
    topSash.setLayout(LayoutUtils.createGridLayout(1, 0, 0, 0, 0, false));

    Composite topSashContent = new Composite(topSash, SWT.None);
    topSashContent.setLayout(LayoutUtils.createGridLayout(2, 5, 0, 0, 0, false));
    topSashContent.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    ((GridLayout) topSashContent.getLayout()).marginBottom = 5;

    /* Create Condition Controls */
    createConditionControls(topSashContent);

    /* Separator */
    new Label(topSash, SWT.SEPARATOR | SWT.HORIZONTAL).setLayoutData(new GridData(SWT.FILL, SWT.END, true, false));

    /* Create Sash */
    Composite bottomSash = new Composite(sashForm, SWT.NONE);
    bottomSash.setLayout(LayoutUtils.createGridLayout(1, 0, 0));
    sashForm.setWeights(new int[] { 50, 50 });

    Composite bottomSashContent = new Composite(bottomSash, SWT.None);
    bottomSashContent.setLayout(LayoutUtils.createGridLayout(1, 5, 2));
    bottomSashContent.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

View Full Code Here

    /* Separate from SashForm */
    Label sep = new Label(rootComposite, SWT.SEPARATOR | SWT.HORIZONTAL);
    sep.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));

    /* SashForm dividing Feed and News View */
    fSashForm = new SashForm(rootComposite, (fInitialLayoutVertical ? SWT.VERTICAL : SWT.HORIZONTAL) | SWT.SMOOTH);
    fSashForm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    if (!fInitialLayoutVertical)
      fSashForm.setBackground(fSashForm.getDisplay().getSystemColor(SWT.COLOR_GRAY));

View Full Code Here

    /* Title Message */
    setMessage("You can use \'?\' for any character and \'*\' for any number of characters in your search.", IMessageProvider.INFORMATION);

    /* Sashform dividing search definition from results */
    fSashForm = new SashForm(parent, SWT.VERTICAL | SWT.SMOOTH);
    fSashForm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
    fSashForm.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WHITE));

    /* Top Area */
    Composite topSash = new Composite(fSashForm, SWT.NONE);
View Full Code Here

        onGenerateName();
      }
    });

    /* Sashform dividing search definition from actions */
    SashForm sashForm = new SashForm(parent, SWT.VERTICAL | SWT.SMOOTH);
    sashForm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    /* Top Sash */
    Composite topSash = new Composite(sashForm, SWT.NONE);
    topSash.setLayout(LayoutUtils.createGridLayout(2, 0, 0, 0, 0, false));
    createConditionControls(topSash);

    /* Bottom Sash */
    Composite bottomSash = new Composite(sashForm, SWT.NONE);
    bottomSash.setLayout(LayoutUtils.createGridLayout(1, 0, 0, 0, 0, false));

    /* Label in between */
    Composite labelContainer = new Composite(bottomSash, SWT.NONE);
    labelContainer.setLayout(LayoutUtils.createGridLayout(1, 10, 3, 0, 0, false));
    ((GridLayout) labelContainer.getLayout()).marginBottom = 2;
    labelContainer.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));
    Label explanationLabel = new Label(labelContainer, SWT.NONE);
    explanationLabel.setText(Messages.NewsFilterDialog_PERFORM_ACTIONS);

    /* Action Controls */
    createActionControls(bottomSash);

    /* Separator */
    new Label(bottomSash, SWT.SEPARATOR | SWT.HORIZONTAL).setLayoutData(new GridData(SWT.FILL, SWT.END, true, false));

    /* Set weights to even */
    sashForm.setWeights(new int[] { 50, 50 });

    applyDialogFont(parent);

    return parent;
  }
View Full Code Here

TOP

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

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.