Package org.eclipse.swt.layout

Examples of org.eclipse.swt.layout.GridData


    // ----------------------
    // Any Look & Feel settings that don't really change the way the user
    // normally interacts
    Label label;
    GridLayout layout;
    GridData gridData;
    Composite cSection = new Composite(parent, SWT.NULL);
    cSection.setLayoutData(new GridData(GridData.FILL_BOTH));
    layout = new GridLayout();
    layout.numColumns = 2;
    cSection.setLayout(layout);

    label = new Label(cSection, SWT.NULL);
    Messages.setLanguageText(label, MSG_PREFIX + "defaultSortOrder");
    int[] sortOrderValues = {
      0,
      1,
      2
    };
    String[] sortOrderLabels = {
      MessageText.getString(MSG_PREFIX + "defaultSortOrder.asc"),
      MessageText.getString(MSG_PREFIX + "defaultSortOrder.desc"),
      MessageText.getString(MSG_PREFIX + "defaultSortOrder.flip")
    };
    new IntListParameter(cSection, "config.style.table.defaultSortOrder",
        sortOrderLabels, sortOrderValues);

    if (userMode > 0) {
      label = new Label(cSection, SWT.NULL);
      Messages.setLanguageText(label, MSG_PREFIX + "guiUpdate");
      int[] values = {
        100,
        250,
        500,
        1000,
        2000,
        5000,
        10000,
        15000
      };
      String[] labels = {
        "100 ms",
        "250 ms",
        "500 ms",
        "1 s",
        "2 s",
        "5 s",
        "10 s",
        "15 s"
      };
      new IntListParameter(cSection, "GUI Refresh", 1000, labels, values);

      label = new Label(cSection, SWT.NULL);
      Messages.setLanguageText(label, MSG_PREFIX + "graphicsUpdate");
      gridData = new GridData();
      IntParameter graphicUpdate = new IntParameter(cSection, "Graphics Update",
          1, -1);
      graphicUpdate.setLayoutData(gridData);

      label = new Label(cSection, SWT.NULL);
      Messages.setLanguageText(label, MSG_PREFIX + "reOrderDelay");
      gridData = new GridData();
      IntParameter reorderDelay = new IntParameter(cSection, "ReOrder Delay");
      reorderDelay.setLayoutData(gridData);

      new BooleanParameter(cSection, "NameColumn.showProgramIcon", MSG_PREFIX
          + "showProgramIcon").setLayoutData(new GridData(SWT.FILL, SWT.LEFT, true, false, 2, 1));
    }

    if (Constants.isWindows) {
      new BooleanParameter(cSection, "Table.extendedErase", MSG_PREFIX
          + "extendedErase").setLayoutData(new GridData(SWT.FILL,
          SWT.LEFT, true, false, 2, 1));
    }

    {
      Group cLibrary = new Group(cSection, SWT.NULL);
      Messages.setLanguageText(cLibrary, MSG_PREFIX + "library");
      layout = new GridLayout();
      layout.numColumns = 2;
      cLibrary.setLayout(layout);
      cLibrary.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false, 2, 1));

      // double-click

      label = new Label(cLibrary, SWT.NULL);
      Messages.setLanguageText(label, "ConfigView.label.dm.dblclick");

      String[] dblclickOptions = {
        "ConfigView.option.dm.dblclick.play",
        "ConfigView.option.dm.dblclick.details",
        "ConfigView.option.dm.dblclick.show",
      };

      String dblclickLabels[] = new String[dblclickOptions.length];
      String dblclickValues[] = new String[dblclickOptions.length];

      for (int i = 0; i < dblclickOptions.length; i++) {

        dblclickLabels[i] = MessageText.getString(dblclickOptions[i]);
        dblclickValues[i] = "" + i;
      }
      new StringListParameter(cLibrary, "list.dm.dblclick", dblclickLabels,
          dblclickValues);


      new BooleanParameter(cLibrary, "Table.useTree", MSG_PREFIX
          + "useTree").setLayoutData(new GridData(SWT.FILL,
              SWT.LEFT, true, false, 2, 1));

      if (userMode > 1) {
        new BooleanParameter(cLibrary, "DND Always In Incomplete", MSG_PREFIX
            + "DNDalwaysInIncomplete").setLayoutData(new GridData(SWT.FILL,
                SWT.LEFT, true, false, 2, 1));
      }

      new BooleanParameter(cLibrary, "MyTorrentsView.alwaysShowHeader",
          "ConfigView.label.alwaysShowLibraryHeader").setLayoutData(new GridData(
              SWT.FILL, SWT.LEFT, true, false, 2, 1));

      if (isAZ3) {
        new BooleanParameter(cLibrary, "Library.CatInSideBar", MSG_PREFIX
            + "CatInSidebar").setLayoutData(new GridData(SWT.FILL,
                SWT.LEFT, true, false, 2, 1));
      }
    }

    return cSection;
View Full Code Here


  configSectionCreate(
    final Composite parent)
  {
    int userMode = COConfigurationManager.getIntParameter("User Mode");

      GridData gridData;

      Composite gSecurity = new Composite(parent, SWT.NULL);
      gridData = new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL);
      gSecurity.setLayoutData(gridData);
      GridLayout layout = new GridLayout();
      layout.numColumns = 3;
      gSecurity.setLayout(layout);

      // row
     
      Label cert_label = new Label(gSecurity, SWT.NULL );
      Messages.setLanguageText(cert_label, "ConfigView.section.tracker.createcert");

      Button cert_button = new Button(gSecurity, SWT.PUSH);

      Messages.setLanguageText(cert_button, "ConfigView.section.tracker.createbutton");

      cert_button.addListener(SWT.Selection,
          new Listener()
        {
              public void
          handleEvent(Event event)
              {
                new CertificateCreatorWindow();
              }
          });
     
      new Label(gSecurity, SWT.NULL );
     
      // row

      Label  info_label = new Label( gSecurity, SWT.WRAP );
      Messages.setLanguageText( info_label, "ConfigView.section.security.toolsinfo" );
      info_label.setLayoutData(Utils.getWrappableLabelGridData(3, 0));
 
      // row
     
      Label lStatsPath = new Label(gSecurity, SWT.NULL);
     
      Messages.setLanguageText(lStatsPath, "ConfigView.section.security.toolsdir"); //$NON-NLS-1$

      ImageLoader imageLoader = ImageLoader.getInstance();
      Image imgOpenFolder = imageLoader.getImage("openFolderButton");     
     
      gridData = new GridData();
     
      gridData.widthHint = 150;
     
      final StringParameter pathParameter = new StringParameter(gSecurity, "Security.JAR.tools.dir", ""); //$NON-NLS-1$ //$NON-NLS-2$
     
      pathParameter.setLayoutData(gridData);
     
      Button browse = new Button(gSecurity, SWT.PUSH);
     
      browse.setImage(imgOpenFolder);
     
      imgOpenFolder.setBackground(browse.getBackground());
     
      browse.setToolTipText(MessageText.getString("ConfigView.button.browse"));
     
      browse.addListener(SWT.Selection, new Listener() {
        public void handleEvent(Event event) {
          DirectoryDialog dialog = new DirectoryDialog(parent.getShell(), SWT.APPLICATION_MODAL);
 
          dialog.setFilterPath(pathParameter.getValue());
       
          dialog.setText(MessageText.getString("ConfigView.section.security.choosetoolssavedir")); //$NON-NLS-1$
       
          String path = dialog.open();
       
          if (path != null) {
            pathParameter.setValue(path);
          }
        }
      });
     
    
        // row
     
      Label pw_label = new Label(gSecurity, SWT.NULL );
      Messages.setLanguageText(pw_label, "ConfigView.section.security.clearpasswords");

      Button pw_button = new Button(gSecurity, SWT.PUSH);

      Messages.setLanguageText(pw_button, "ConfigView.section.security.clearpasswords.button");

      pw_button.addListener(SWT.Selection,
          new Listener()
        {
              public void
          handleEvent(Event event)
              {
                SESecurityManager.clearPasswords();
               
                CryptoManagerFactory.getSingleton().clearPasswords();
              }
          });
     
      new Label(gSecurity, SWT.NULL );
 
      if ( userMode >= 2 ){
       
        final CryptoManager crypt_man = CryptoManagerFactory.getSingleton();
       
        final Group crypto_group = new Group(gSecurity, SWT.NULL);
        gridData = new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.FILL_HORIZONTAL);
        gridData.horizontalSpan = 3;
        crypto_group.setLayoutData(gridData);
        layout = new GridLayout();
        layout.numColumns = 3;
        crypto_group.setLayout(layout);
       
      Messages.setLanguageText(crypto_group,"ConfigView.section.security.group.crypto");
     
        // wiki link
     
      final Label linkLabel = new Label(crypto_group, SWT.NULL);
      linkLabel.setText(MessageText.getString("ConfigView.label.please.visit.here"));
      linkLabel.setData("http://wiki.vuze.com/w/Public_Private_Keys");
      linkLabel.setCursor(linkLabel.getDisplay().getSystemCursor(SWT.CURSOR_HAND));
      linkLabel.setForeground(Colors.blue);
      gridData = new GridData();
      gridData.horizontalSpan = 3;
      linkLabel.setLayoutData(gridData);
      linkLabel.addMouseListener(new MouseAdapter() {
        public void mouseDoubleClick(MouseEvent arg0) {
          Utils.launch((String) ((Label) arg0.widget).getData());
View Full Code Here

    pieces = new boolean[manager.getNbPieces()];

    this.display = parent.getDisplay();

    gFile = new Composite(genComposite, SWT.SHADOW_OUT);
    GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
    gFile.setLayoutData(gridData);
    GridLayout fileLayout = new GridLayout();
    fileLayout.marginHeight = 0;
    fileLayout.marginWidth = 10;
    fileLayout.numColumns = 3;
    gFile.setLayout(fileLayout);

    Label piecesInfo = new Label(gFile, SWT.LEFT);
    Messages.setLanguageText(piecesInfo, "GeneralView.section.downloaded");
    gridData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
    piecesInfo.setLayoutData(gridData);

    piecesImage = new Canvas(gFile, SWT.NULL);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    gridData.widthHint = 150;
    gridData.heightHint = 25;
    piecesImage.setLayoutData(gridData);

    piecesPercent = new BufferedLabel(gFile, SWT.RIGHT);
    gridData = new GridData(GridData.HORIZONTAL_ALIGN_END);
    gridData.widthHint = 50;
    piecesPercent.setLayoutData(gridData);

    Label availabilityInfo = new Label(gFile, SWT.LEFT);
    Messages.setLanguageText(availabilityInfo, "GeneralView.section.availability");
    gridData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
    availabilityInfo.setLayoutData(gridData);

    availabilityImage = new Canvas(gFile, SWT.NULL);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    gridData.widthHint = 150;
    gridData.heightHint = 25;
    availabilityImage.setLayoutData(gridData);
    Messages.setLanguageText(availabilityImage, "GeneralView.label.status.pieces_available.tooltip");

    availabilityPercent = new BufferedLabel(gFile, SWT.RIGHT);
    gridData = new GridData(GridData.HORIZONTAL_ALIGN_END);
    gridData.widthHint = 50;
    availabilityPercent.setLayoutData(gridData);
    Messages.setLanguageText(availabilityPercent.getWidget(), "GeneralView.label.status.pieces_available.tooltip");
   
    gTransfer = new Group(genComposite, SWT.SHADOW_OUT);
    Messages.setLanguageText(gTransfer, "GeneralView.section.transfer"); //$NON-NLS-1$
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    gTransfer.setLayoutData(gridData);

    GridLayout layoutTransfer = new GridLayout();
    layoutTransfer.numColumns = 6;
    gTransfer.setLayout(layoutTransfer);

    Label label = new Label(gTransfer, SWT.LEFT);
    Messages.setLanguageText(label, "GeneralView.label.timeelapsed"); //$NON-NLS-1$
    timeElapsed = new BufferedLabel(gTransfer, SWT.LEFT);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    timeElapsed.setLayoutData(gridData);
    label = new Label(gTransfer, SWT.LEFT);
    Messages.setLanguageText(label, "GeneralView.label.remaining"); //$NON-NLS-1$
    timeRemaining = new BufferedLabel(gTransfer, SWT.LEFT);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    timeRemaining.setLayoutData(gridData);
    label = new Label(gTransfer, SWT.LEFT); //$NON-NLS-1$
    Messages.setLanguageText(label, "GeneralView.label.shareRatio");
    shareRatio = new BufferedLabel(gTransfer, SWT.LEFT); //$NON-NLS-1$
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    shareRatio.setLayoutData(gridData);

    label = new Label(gTransfer, SWT.LEFT);
    Messages.setLanguageText(label, "GeneralView.label.downloaded"); //$NON-NLS-1$
    download = new BufferedLabel(gTransfer, SWT.LEFT);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    download.setLayoutData(gridData);
    label = new Label(gTransfer, SWT.LEFT);
    Messages.setLanguageText(label, "GeneralView.label.downloadspeed"); //$NON-NLS-1$
    downloadSpeed = new BufferedLabel(gTransfer, SWT.LEFT);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    downloadSpeed.setLayoutData(gridData);
    label = new Label(gTransfer, SWT.LEFT); //$NON-NLS-1$
    Messages.setLanguageText(label, "GeneralView.label.hashfails");
    hashFails = new BufferedLabel(gTransfer, SWT.LEFT); //$NON-NLS-1$
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    hashFails.setLayoutData(gridData);
   
    label = new Label(gTransfer, SWT.LEFT);
    Messages.setLanguageText(label, "GeneralView.label.uploaded"); //$NON-NLS-1$
    upload = new BufferedLabel(gTransfer, SWT.LEFT);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    upload.setLayoutData(gridData);   
    label = new Label(gTransfer, SWT.LEFT);
    Messages.setLanguageText(label, "GeneralView.label.uploadspeed"); //$NON-NLS-1$
    uploadSpeed = new BufferedLabel(gTransfer, SWT.LEFT);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    gridData.horizontalSpan = 3;
    uploadSpeed.setLayoutData(gridData);
   
      // blah
   
    label = new Label(gTransfer, SWT.LEFT);
    Messages.setLanguageText(label, "GeneralView.label.seeds");
    seeds = new BufferedLabel(gTransfer, SWT.LEFT);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    seeds.setLayoutData(gridData);

    label = new Label(gTransfer, SWT.LEFT);
    Messages.setLanguageText(label, "GeneralView.label.peers");
    peers = new BufferedLabel(gTransfer, SWT.LEFT);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    peers.setLayoutData(gridData);
   
    label = new Label(gTransfer, SWT.LEFT);
    Messages.setLanguageText(label, "GeneralView.label.completed");
    completedLbl = new BufferedLabel(gTransfer, SWT.LEFT);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    completedLbl.setLayoutData(gridData);


   
    label = new Label(gTransfer, SWT.LEFT);
    Messages.setLanguageText(label, "GeneralView.label.totalspeed");
    totalSpeed = new BufferedLabel(gTransfer, SWT.LEFT);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    totalSpeed.setLayoutData(gridData);
   
   
    label = new Label(gTransfer, SWT.LEFT);
    Messages.setLanguageText(label, "GeneralView.label.swarm_average_completion");
    ave_completion = new BufferedLabel(gTransfer, SWT.LEFT);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    ave_completion.setLayoutData(gridData);
   
    label = new Label(gTransfer, SWT.LEFT);
    Messages.setLanguageText(label, "GeneralView.label.distributedCopies");
    distributedCopies = new BufferedLabel(gTransfer, SWT.LEFT);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    distributedCopies.setLayoutData(gridData);
   

    ////////////////////////

    gInfo = new Group(genComposite, SWT.SHADOW_OUT);
    Messages.setLanguageText(gInfo, "GeneralView.section.info");
    gridData = new GridData(GridData.FILL_BOTH);
    gInfo.setLayoutData(gridData);

    GridLayout layoutInfo = new GridLayout();
    layoutInfo.numColumns = 4;
    gInfo.setLayout(layoutInfo);

    label = new Label(gInfo, SWT.LEFT);
    Messages.setLanguageText(label, "GeneralView.label.filename"); //$NON-NLS-1$
    fileName = new BufferedLabel(gInfo, SWT.LEFT);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    fileName.setLayoutData(gridData);

    label = new Label(gInfo, SWT.LEFT);
    Messages.setLanguageText(label, "GeneralView.label.status"); //$NON-NLS-1$
    torrentStatus = new BufferedLabel(gInfo, SWT.LEFT);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    torrentStatus.setLayoutData(gridData);

    label = new Label(gInfo, SWT.LEFT);
    Messages.setLanguageText(label, "GeneralView.label.savein"); //$NON-NLS-1$
    saveIn = new BufferedLabel(gInfo, SWT.LEFT);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    gridData.horizontalSpan = 3;
    saveIn.setLayoutData(gridData);

    label = new Label(gInfo, SWT.LEFT);
    Messages.setLanguageText(label, "GeneralView.label.totalsize"); //$NON-NLS-1$
    fileSize = new BufferedLabel(gInfo, SWT.LEFT);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    fileSize.setLayoutData(gridData);

    label = new Label(gInfo, SWT.LEFT);
    Messages.setLanguageText(label, "GeneralView.label.numberofpieces"); //$NON-NLS-1$
    pieceNumber = new BufferedLabel(gInfo, SWT.LEFT);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    pieceNumber.setLayoutData(gridData);

    label = new Label(gInfo, SWT.LEFT);
    Messages.setLanguageText(label, "GeneralView.label.hash"); //$NON-NLS-1$
    hash = new BufferedLabel(gInfo, SWT.LEFT);
    Messages.setLanguageText(hash.getWidget(), "GeneralView.label.hash.tooltip", true);
   
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    hash.setLayoutData(gridData);
      // click on hash -> copy to clipboard
    hash.setCursor(display.getSystemCursor(SWT.CURSOR_HAND));
    hash.setForeground(Colors.blue);
    label.addMouseListener(new MouseAdapter() {
      public void mouseDoubleClick(MouseEvent arg0) {
        String hash_str = hash.getText();
        if(hash_str != null && hash_str.length() != 0)
          new Clipboard(display).setContents(new Object[] {hash_str.replaceAll(" ","")}, new Transfer[] {TextTransfer.getInstance()});
      }
      public void mouseDown(MouseEvent arg0) {
        String hash_str = hash.getText();
        if(hash_str != null && hash_str.length() != 0)
          new Clipboard(display).setContents(new Object[] {hash_str.replaceAll(" ","")}, new Transfer[] {TextTransfer.getInstance()});
      }
    });
    hash.addMouseListener(new MouseAdapter() {
      public void mouseDoubleClick(MouseEvent arg0) {
        String hash_str = hash.getText();
        if(hash_str != null && hash_str.length() != 0)
          new Clipboard(display).setContents(new Object[] {hash_str.replaceAll(" ","")}, new Transfer[] {TextTransfer.getInstance()});
      }
      public void mouseDown(MouseEvent arg0) {
        String hash_str = hash.getText();
        if(hash_str != null && hash_str.length() != 0)
          new Clipboard(display).setContents(new Object[] {hash_str.replaceAll(" ","")}, new Transfer[] {TextTransfer.getInstance()});
      }
    });
   
   
    label = new Label(gInfo, SWT.LEFT);
    Messages.setLanguageText(label, "GeneralView.label.size");
    pieceSize = new BufferedLabel(gInfo, SWT.LEFT);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    pieceSize.setLayoutData(gridData);
   
    label = new Label(gInfo, SWT.LEFT);
    Messages.setLanguageText(label, "GeneralView.label.creationdate");
    creation_date = new BufferedLabel(gInfo, SWT.LEFT);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    creation_date.setLayoutData(gridData);
   
    label = new Label(gInfo, SWT.LEFT);
    Messages.setLanguageText(label, "GeneralView.label.private");
    privateStatus = new BufferedLabel(gInfo, SWT.LEFT);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    privateStatus.setLayoutData(gridData);   

  // empty row
    label = new Label(gInfo, SWT.LEFT);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    gridData.horizontalSpan = 4;
    label.setLayoutData(gridData);
   
   
    label = new Label(gInfo, SWT.LEFT);
    label.setCursor(display.getSystemCursor(SWT.CURSOR_HAND));
    label.setForeground(Colors.blue);
    Messages.setLanguageText(label, "GeneralView.label.user_comment");

    try {
      user_comment = new Link(gInfo, SWT.LEFT | SWT.WRAP);
      ((Link)user_comment).addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent e) {
          Utils.launch(e.text);
        }
      });
    } catch (Throwable e) {
      user_comment = new Label(gInfo, SWT.LEFT | SWT.WRAP);
    }
   
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    gridData.horizontalSpan = 3;
    user_comment.setLayoutData(gridData);
   
    label.addMouseListener(new MouseAdapter() {
      private void editComment() {
        TorrentUtil.promptUserForComment(new DownloadManager[] {manager});
      }

        public void mouseDoubleClick(MouseEvent arg0) {editComment();}
        public void mouseDown(MouseEvent arg0) {editComment();}
      });

    label = new Label(gInfo, SWT.LEFT);
    gridData = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
    label.setLayoutData(gridData);
    Messages.setLanguageText(label, "GeneralView.label.comment");
   
    try {
      lblComment = new Link(gInfo, SWT.LEFT | SWT.WRAP);
      ((Link)lblComment).addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent e) {
          Utils.launch(e.text);
        }
      });
    } catch (Throwable e) {
      lblComment = new Label(gInfo, SWT.LEFT | SWT.WRAP);
    }
    gridData = new GridData(GridData.FILL_BOTH);
    gridData.horizontalSpan = 3;
    lblComment.setLayoutData(gridData);
   
    piecesImage.addListener(SWT.Paint, new Listener() {
View Full Code Here

  private final int REQUIRED_MODE = 2;

  // @see org.gudy.azureus2.ui.swt.plugins.UISWTConfigSection#configSectionCreate(org.eclipse.swt.widgets.Composite)
  public Composite configSectionCreate(Composite parent) {
    GridData gridData;
    GridLayout layout;
    Label label;

    Composite cSection = new Composite(parent, SWT.NULL);

    gridData = new GridData(GridData.VERTICAL_ALIGN_FILL
        | GridData.HORIZONTAL_ALIGN_FILL);
    cSection.setLayoutData(gridData);
    layout = new GridLayout();
    layout.numColumns = 1;
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    cSection.setLayout(layout);

    int userMode = COConfigurationManager.getIntParameter("User Mode");
    if (userMode < REQUIRED_MODE) {
      label = new Label(cSection, SWT.WRAP);
      gridData = new GridData();
      gridData.horizontalSpan = 2;
      label.setLayoutData(gridData);

      final String[] modeKeys = { "ConfigView.section.mode.beginner",
          "ConfigView.section.mode.intermediate",
View Full Code Here

    Utils.setShellIcon(wizardWindow);

    Composite cTitle = new Composite(wizardWindow, SWT.NULL);
    Color white = display.getSystemColor(SWT.COLOR_WHITE);
    cTitle.setBackground(white);
    GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
    cTitle.setLayoutData(gridData);
    GridLayout titleLayout = new GridLayout();
    titleLayout.numColumns = 1;
    cTitle.setLayout(titleLayout);
    title = new Label(cTitle, SWT.NULL);
    title.setBackground(white);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    title.setLayoutData(gridData);
    Font font = title.getFont();
    FontData[] data = font.getFontData();
    for(int i = 0 ; i < data.length ; i++) {
      data[i].setStyle(SWT.BOLD);
    }
    titleFont=new Font(display,data);
    title.setFont(titleFont);
    currentInfo = new Label(cTitle, SWT.NULL);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    currentInfo.setLayoutData(gridData);
    currentInfo.setBackground(white);
    errorMessage = new Label(cTitle, SWT.NULL);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    errorMessage.setLayoutData(gridData);
    errorMessage.setBackground(white);
    Color red = display.getSystemColor(SWT.COLOR_RED);
    errorMessage.setForeground(red);

    gridData = new GridData(GridData.FILL_HORIZONTAL);
    new Label(wizardWindow, SWT.SEPARATOR | SWT.HORIZONTAL).setLayoutData(gridData);

    panel = new Composite(wizardWindow, SWT.NULL);
    gridData = new GridData(GridData.FILL_BOTH);
    panel.setLayoutData(gridData);

    gridData = new GridData(GridData.FILL_HORIZONTAL);
    new Label(wizardWindow, SWT.SEPARATOR | SWT.HORIZONTAL).setLayoutData(gridData);

    Composite cButtons = new Composite(wizardWindow, SWT.NULL);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    cButtons.setLayoutData(gridData);
    GridLayout layoutButtons = new GridLayout();
    layoutButtons.numColumns = 5;
    cButtons.setLayout(layoutButtons);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    new Label(cButtons, SWT.NULL).setLayoutData(gridData);

    cancel = new Button(cButtons, SWT.PUSH);
    gridData = new GridData();
    gridData.widthHint = 90;
    gridData.horizontalAlignment = GridData.CENTER;
    cancel.setLayoutData(gridData);
    Messages.setLanguageText(cancel, "Button.cancel");
   
    previous = new Button(cButtons, SWT.PUSH);
    gridData = new GridData();
    gridData.widthHint = 90;
    gridData.horizontalAlignment = GridData.END;
    previous.setLayoutData(gridData);
    Messages.setLanguageText(previous, "wizard.previous");

    next = new Button(cButtons, SWT.PUSH);
    gridData = new GridData();
    gridData.widthHint = 90;
    gridData.horizontalAlignment = GridData.BEGINNING;
    next.setLayoutData(gridData);
    Messages.setLanguageText(next, "wizard.next");

    finish = new Button(cButtons, SWT.PUSH);
    gridData = new GridData();
    gridData.widthHint = 90;
    gridData.horizontalAlignment = GridData.CENTER;
    finish.setLayoutData(gridData);
    Messages.setLanguageText(finish, "wizard.finish");
View Full Code Here

    return REQUIRED_MODE;
  }


  public Composite configSectionCreate(final Composite parent) {
    GridData gridData;
    GridLayout layout;
    Label label;

    Composite cSection = new Composite(parent, SWT.NULL);
    gridData = new GridData(GridData.VERTICAL_ALIGN_FILL
        | GridData.HORIZONTAL_ALIGN_FILL);
    cSection.setLayoutData(gridData);
    layout = new GridLayout();
    layout.marginWidth = 0;
    layout.numColumns = 2;
    cSection.setLayout(layout);

    // password

    label = new Label(cSection, SWT.NULL);
    Messages.setLanguageText(label, LBLKEY_PREFIX + "password");

    gridData = new GridData();
    gridData.widthHint = 150;
    PasswordParameter pw1 = new PasswordParameter(cSection, "Password");
    pw1.setLayoutData(gridData);
    Text t1 = (Text) pw1.getControl();

    //password confirm

    label = new Label(cSection, SWT.NULL);
    Messages.setLanguageText(label, LBLKEY_PREFIX + "passwordconfirm");
    gridData = new GridData();
    gridData.widthHint = 150;
    PasswordParameter pw2 = new PasswordParameter(cSection, "Password Confirm");
    pw2.setLayoutData(gridData);
    Text t2 = (Text) pw2.getControl();

    // password activated

    label = new Label(cSection, SWT.NULL);
    Messages.setLanguageText(label, LBLKEY_PREFIX + "passwordmatch");
    passwordMatch = new Label(cSection, SWT.NULL);
    gridData = new GridData();
    gridData.widthHint = 150;
    passwordMatch.setLayoutData(gridData);
    refreshPWLabel();

    t1.addModifyListener(new ModifyListener() {
View Full Code Here

  }

 

  public Composite configSectionCreate(final Composite parent) {
    GridData gridData;
    GridLayout layout;

    // main tab set up
    Composite gMainTab = new Composite(parent, SWT.NULL);

    gridData = new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL);
    gMainTab.setLayoutData(gridData);
    layout = new GridLayout();
    layout.numColumns = 3;
    gMainTab.setLayout(layout);
   
View Full Code Here

    GridLayout layout = new GridLayout();
    layout.numColumns = 1;
    rootPanel.setLayout(layout);

    Composite panel = new Composite(rootPanel, SWT.NULL);
    GridData gridData = new GridData(GridData.VERTICAL_ALIGN_CENTER | GridData.FILL_HORIZONTAL);
    panel.setLayoutData(gridData);
    layout = new GridLayout();
    layout.numColumns = 3;
    panel.setLayout(layout);

    //Line :
    // Multi-Tracker Configuration
   
    final Label labelTitle = new Label(panel,SWT.NULL);
    Messages.setLanguageText(labelTitle, "wizard.multitracker.configuration");
    gridData = new GridData();
    gridData.horizontalSpan = 3;
    labelTitle.setLayoutData(gridData)
   
    configList = new Combo(panel,SWT.READ_ONLY);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    gridData.horizontalSpan = 3;
    configList.setLayoutData(gridData);
    configList.addListener(SWT.Selection,new Listener() {
      public void handleEvent(Event e) {               
        updateTrackers();
        refreshDetails();
      }
    });
          
    btnNew = new Button(panel, SWT.PUSH);  
    Messages.setLanguageText(btnNew, "wizard.multitracker.new");
    gridData = new GridData();
    gridData.widthHint = 100;
    btnNew.setLayoutData(gridData);
    btnNew.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event e) {
        List group = new ArrayList();
        List tracker = new ArrayList();
        tracker.add(((NewTorrentWizard)wizard).trackerURL);
        group.add(tracker);
        new MultiTrackerEditor(null,group,MultiTrackerPanel.this);
      }
    });
   
    btnEdit = new Button(panel, SWT.PUSH);  
    Messages.setLanguageText(btnEdit, "wizard.multitracker.edit");
    gridData = new GridData();
    gridData.widthHint = 100;
    btnEdit.setLayoutData(gridData);
    btnEdit.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event e) {
        int selection = configList.getSelectionIndex();
        String selected = configList.getItem(selection);
        Map multiTrackers = TrackersUtil.getInstance().getMultiTrackers();
        new MultiTrackerEditor(selected,(List)multiTrackers.get(selected),MultiTrackerPanel.this);
      }
    });
   
    btnDelete = new Button(panel, SWT.PUSH);  
    Messages.setLanguageText(btnDelete, "wizard.multitracker.delete");
    gridData = new GridData(GridData.HORIZONTAL_ALIGN_END);
    gridData.widthHint = 100;   
    btnDelete.setLayoutData(gridData);
    btnDelete.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event e) {
        int selection = configList.getSelectionIndex();
        String selected = configList.getItem(selection);
        TrackersUtil.getInstance().removeMultiTracker(selected);
        refreshList("");
        refreshDetails();
        setEditDeleteEnable();
      }
    });
    final Label labelSeparator = new Label(panel,SWT.SEPARATOR | SWT.HORIZONTAL);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    gridData.horizontalSpan = 3;
    labelSeparator.setLayoutData(gridData);
   
    configDetails = new Tree(panel,SWT.BORDER);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    gridData.heightHint = 150;
    gridData.horizontalSpan = 3;
    configDetails.setLayoutData(gridData);   
   
    refreshList(((NewTorrentWizard)wizard).multiTrackerConfig);
View Full Code Here

    errorColor = Colors.colorError;

    /*
     * Give this Composite some margin and spacing
     */
    setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
    GridLayout gLayout = new GridLayout(2, false);
    gLayout.marginWidth = 25;
    gLayout.marginTop =15;
    gLayout.marginBottom=10;
    setLayout(gLayout);
View Full Code Here

   * @param pReport
   */
  private void createControls(IProgressReport pReport) {

    imageLabel = new Label(this, SWT.NONE);
    imageLabel.setLayoutData(new GridData(SWT.BEGINNING, SWT.TOP, false, false,1,3));

   
    /*
     * Creates the main panel
     */
    progressPanel = new Composite(this, SWT.NONE);
    progressPanel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
    GridLayout rightLayout = new GridLayout(4, false);
    rightLayout.marginHeight = 0;
    rightLayout.marginWidth = 0;
    progressPanel.setLayout(rightLayout);

    /*
     * Creates all the controls
     */

    nameLabel = new Label(progressPanel, SWT.WRAP);
    nameLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true,
        false, 4, 1));

    pBar = new AZProgressBar(progressPanel, pReport.isIndeterminate());
    pBar.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));

    actionLabel_cancel = new Label(progressPanel, SWT.NONE);
    actionLabel_cancel.setLayoutData(new GridData(SWT.END, SWT.CENTER, false,
        false));

    actionLabel_remove = new Label(progressPanel, SWT.NONE);
    actionLabel_remove.setLayoutData(new GridData(SWT.END, SWT.CENTER, false,
        false));

    actionLabel_retry = new Label(progressPanel, SWT.NONE);
    actionLabel_retry.setLayoutData(new GridData(SWT.END, SWT.CENTER, false,
        false));

    statusLabel = new Label(progressPanel, SWT.NONE);
    statusLabel.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, true, false,
        2, 1));

    /*
     * Creates the detail section
     */
 
View Full Code Here

TOP

Related Classes of org.eclipse.swt.layout.GridData

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.