Package org.eclipse.swt.layout

Examples of org.eclipse.swt.layout.GridLayout


   */
  public void show() {
    wizard.setTitle(MessageText.getString("wizard.directory"));
    wizard.setCurrentInfo(MessageText.getString("wizard.choosedirectory"));
    Composite panel = wizard.getPanel();
    GridLayout layout = new GridLayout();
    layout.numColumns = 3;
    panel.setLayout(layout);
    Label label = new Label(panel, SWT.NULL);
    Messages.setLanguageText(label, "wizard.directory");
    file = new Text(panel, SWT.BORDER);
View Full Code Here


 
  wizard.setTitle(MessageText.getString("installPluginsWizard.mode.title"));
  wizard.setErrorMessage("");
 
  Composite rootPanel = wizard.getPanel();
  GridLayout layout = new GridLayout();
  layout.numColumns = 1;
  rootPanel.setLayout(layout);

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

  Button bListMode = new Button(panel,SWT.RADIO);
  Messages.setLanguageText(bListMode,"installPluginsWizard.mode.list");
  bListMode.setData("mode",new Integer(MODE_FROM_LIST));
  if(((InstallPluginWizard)wizard).mode == MODE_FROM_LIST) bListMode.setSelection(true);
   
  Button bFileMode = new Button(panel,SWT.RADIO);
  Messages.setLanguageText(bFileMode,"installPluginsWizard.mode.file");
  bFileMode.setData("mode",new Integer(MODE_FROM_FILE));
  if(((InstallPluginWizard)wizard).mode == MODE_FROM_FILE) bFileMode.setSelection(true);
 
  Listener modeListener = new Listener() {
    public void handleEvent(Event e) {
      mode = ((Integer) e.widget.getData("mode")).intValue();
      ((InstallPluginWizard)wizard).mode = mode;
    }
  };

  bListMode.addListener(SWT.Selection,modeListener);
  bFileMode.addListener(SWT.Selection,modeListener);
 
  if(userMode < 2){
      Group cWiki = new Group(panel, SWT.WRAP);
      cWiki.setText(MessageText.getString("installPluginsWizard.installMode.info.title"));
      gridData = new GridData( GridData.VERTICAL_ALIGN_CENTER | GridData.FILL_HORIZONTAL);
      gridData.verticalIndent = 15;
      cWiki.setLayoutData(gridData);
      layout = new GridLayout();
      layout.numColumns = 4;
      layout.marginHeight = 0;
      cWiki.setLayout(layout);
     
      gridData = new GridData(GridData.VERTICAL_ALIGN_CENTER | GridData.FILL_HORIZONTAL);
View Full Code Here

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

    gridData = new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL);
    cSection.setLayoutData(gridData);
    GridLayout advanced_layout = new GridLayout();
    advanced_layout.numColumns = 2;
    cSection.setLayout(advanced_layout);

    int userMode = COConfigurationManager.getIntParameter("User Mode");
View Full Code Here

 

  public Composite configSectionCreate(final Composite parent) {
    GridData gridData;
    GridLayout layout;
    String initsMode = "";
    final String[] text = {""};
    final String[] messTexts = {"ConfigView.section.mode.beginner.wiki.definitions",
        "ConfigView.section.mode.intermediate.wiki.host",
        "ConfigView.section.mode.advanced.wiki.main",
        "ConfigView.section.mode.intermediate.wiki.publish"
    };
    final String[] links = {"http://wiki.vuze.com/w/This_funny_word",
        "http://wiki.vuze.com/w/HostingFiles",
        "http://wiki.vuze.com/w/Main_Page",
        "http://wiki.vuze.com/w/PublishingFiles"
    };
   
    int userMode = COConfigurationManager.getIntParameter("User Mode");

    final Composite cMode = new Composite(parent, SWT.WRAP);
    gridData = new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL);
    cMode.setLayoutData(gridData);
    layout = new GridLayout();
    layout.numColumns = 4;
    layout.marginHeight = 0;
    cMode.setLayout(layout);
   
    gridData = new GridData();
    gridData.horizontalSpan = 4;
    final Group gRadio = new Group(cMode, SWT.WRAP);
    Messages.setLanguageText(gRadio, "ConfigView.section.mode.title");
    gRadio.setLayoutData(gridData);
    gRadio.setLayout(new RowLayout(SWT.HORIZONTAL));

    Button button0 = new Button (gRadio, SWT.RADIO);
    Messages.setLanguageText(button0, "ConfigView.section.mode.beginner");
    button0.setData("iMode", "0");
    button0.setData("sMode", "beginner.text");
   
    Button button1 = new Button (gRadio, SWT.RADIO);
    Messages.setLanguageText(button1, "ConfigView.section.mode.intermediate");
    button1.setData("iMode", "1");
    button1.setData("sMode", "intermediate.text");
   
    Button button2 = new Button (gRadio, SWT.RADIO);
    Messages.setLanguageText(button2, "ConfigView.section.mode.advanced");
    button2.setData("iMode", "2");
    button2.setData("sMode", "advanced.text");
   
    if ( userMode == 0) {
      initsMode = "beginner.text";
      button0.setSelection(true);
    } else if ( userMode == 1) {
      initsMode = "intermediate.text";
      button1.setSelection(true);
    } else {
      initsMode = "advanced.text";
      button2.setSelection(true);
    }

   
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    final Label label = new Label(cMode, SWT.WRAP);
    gridData.horizontalSpan = 4;
    label.setLayoutData(gridData);
  text[0] = MessageText.getString("ConfigView.section.mode." + initsMode);
  label.setText(text[0]);
  label.addListener (SWT.Selection, new Listener () {
    public void handleEvent(Event event) {
      Utils.launch(event.text);
    }
  });
 
  Group gWiki = new Group(cMode, SWT.WRAP);
    gridData = new GridData();
    gridData.widthHint = 350;
    gWiki.setLayoutData(gridData);
    layout = new GridLayout();
    layout.numColumns = 1;
    layout.marginHeight = 1;
    gWiki.setLayout(layout);
   
    gWiki.setText(MessageText.getString("Utils.link.visit"));

      final Label linkLabel = new Label(gWiki, SWT.NULL);
      linkLabel.setText( MessageText.getString( messTexts[userMode] ) );
      linkLabel.setData( links[userMode] );
      linkLabel.setCursor(linkLabel.getDisplay().getSystemCursor(SWT.CURSOR_HAND));
      linkLabel.setForeground(Colors.blue);
      gridData = new GridData(GridData.FILL_HORIZONTAL);
      gridData.horizontalIndent = 10;
      linkLabel.setLayoutData( gridData );
      linkLabel.addMouseListener(new MouseAdapter() {
        public void mouseDoubleClick(MouseEvent arg0) {
          Utils.launch((String) ((Label) arg0.widget).getData());
        }
        public void mouseUp(MouseEvent arg0) {
          Utils.launch((String) ((Label) arg0.widget).getData());
        }
      });
     
      final Label linkLabel1 = new Label(gWiki, SWT.NULL);
      linkLabel1.setText( (userMode == 1)?MessageText.getString(messTexts[3]):"");
      linkLabel1.setData( links[3] );
      linkLabel1.setCursor(linkLabel1.getDisplay().getSystemCursor(SWT.CURSOR_HAND));
      linkLabel1.setForeground(Colors.blue);
      gridData = new GridData(GridData.FILL_HORIZONTAL);
      gridData.horizontalIndent = 10;
      linkLabel1.setLayoutData( gridData );
      linkLabel1.addMouseListener(new MouseAdapter() {
        public void mouseDoubleClick(MouseEvent arg0) {
          Utils.launch((String) ((Label) arg0.widget).getData());
        }
        public void mouseUp(MouseEvent arg0) {
          Utils.launch((String) ((Label) arg0.widget).getData());
        }
      });

   
    Listener radioGroup = new Listener () {
      public void handleEvent (Event event) {
       
        Control [] children = gRadio.getChildren ();
       
        for (int j=0; j<children.length; j++) {
           Control child = children [j];
           if (child instanceof Button) {
             Button button = (Button) child;
             if ((button.getStyle () & SWT.RADIO) != 0) button.setSelection (false);
           }
        }

        Button button = (Button) event.widget;
        button.setSelection (true);
        int mode = Integer.parseInt((String)button.getData("iMode"));
        text[0] = MessageText.getString("ConfigView.section.mode." + (String)button.getData("sMode"));
        label.setText(text[0]);
        linkLabel.setText( MessageText.getString(messTexts[mode]) );
        linkLabel.setData( links[mode] );
        if(mode == 1){
          linkLabel1.setText( MessageText.getString(messTexts[3]) );
          linkLabel1.setData( links[3] );
        } else{
          linkLabel1.setText( "" );
          linkLabel1.setData( "" );
        }
        COConfigurationManager.setParameter("User Mode", Integer.parseInt((String)button.getData("iMode")));
        }
    };
   
    button0.addListener (SWT.Selection, radioGroup);
    button1.addListener (SWT.Selection, radioGroup);
    button2.addListener (SWT.Selection, radioGroup);

    Label padding = new Label(cMode, SWT.NULL );
    gridData = new GridData();
    gridData.horizontalSpan = 3;
    padding.setLayoutData( gridData );
   
      // reset to defaults
   
  Composite gReset = new Composite(cMode, SWT.WRAP);
    gridData = new GridData();
    gridData.horizontalSpan = 4;
    gReset.setLayoutData(gridData);
    layout = new GridLayout();
    layout.numColumns = 3;
    gReset.setLayout(layout);

    Label reset_label = new Label(gReset, SWT.NULL );
    Messages.setLanguageText(reset_label, "ConfigView.section.mode.resetdefaults" );
View Full Code Here

  }
 

  public Composite configSectionCreate(final Composite parent) {
    GridData gridData;
    GridLayout layout;
    Label label;
   
    // 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 = 4;
    gMainTab.setLayout(layout);
   
    int userMode = COConfigurationManager.getIntParameter("User Mode");
   
  if (userMode < REQUIRED_MODE) {
    label = new Label(gMainTab, SWT.WRAP);
    gridData = new GridData();
    label.setLayoutData(gridData);

    final String[] modeKeys = { CFG_PREFIX + "mode.beginner",
        CFG_PREFIX + "mode.intermediate",
        CFG_PREFIX + "mode.advanced" };

    String param1, param2;
    if (REQUIRED_MODE < modeKeys.length)
      param1 = MessageText.getString(modeKeys[REQUIRED_MODE]);
    else
      param1 = String.valueOf(REQUIRED_MODE);
       
    if (userMode < modeKeys.length)
      param2 = MessageText.getString(modeKeys[userMode]);
    else
      param2 = String.valueOf(userMode);

    label.setText(MessageText.getString("ConfigView.notAvailableForMode",
        new String[] { param1, param2 } ));

    return gMainTab;
  }
   
      // MAIN TAB DATA

     // row
   
    if(userMode>0) { // XXX

    label = new Label(gMainTab, SWT.NULL);
    Messages.setLanguageText(label, CFG_PREFIX + "tracker.ip");

    final StringParameter tracker_ip = new StringParameter(gMainTab, "Tracker IP", "" );

    gridData = new GridData();
    gridData.widthHint = 120;
    tracker_ip.setLayoutData( gridData );

    Button check_button = new Button(gMainTab, SWT.PUSH);
    gridData = new GridData();
    gridData.horizontalSpan = 2;
    check_button.setLayoutData(gridData);
   
    Messages.setLanguageText(check_button, CFG_PREFIX + "tracker.checkip"); //$NON-NLS-1$

    final Display display = gMainTab.getDisplay();

    check_button.addListener(SWT.Selection, new Listener() {
        public void handleEvent(Event event) {
          IpCheckerWizard wizard = new IpCheckerWizard();
          wizard.setIpSetterCallBack(new IpSetterCallBack() {
              public void setIp(final String ip) {
                if(display == null || display.isDisposed())
                  return;
                  display.asyncExec(new AERunnable(){
                  public void runSupport() {
                    if(tracker_ip != null)
                      tracker_ip.setValue(ip);
                  }
                });
              }
           }); // setIPSetterCallback
         }
    });


    // row

    final BooleanParameter nonsslEnable =
        new BooleanParameter(gMainTab, "Tracker Port Enable",
                             CFG_PREFIX + "tracker.port");

    IntParameter tracker_port = new IntParameter(gMainTab, "Tracker Port", 0, 65535);

    gridData = new GridData();
    tracker_port.setLayoutData( gridData );

    final StringParameter tracker_port_backup = new StringParameter(gMainTab, "Tracker Port Backups", "" );

    gridData = new GridData();
    gridData.widthHint = 100;
    tracker_port_backup.setLayoutData( gridData );
   
    Label tracker_port_backup_label = new Label(gMainTab, SWT.NULL );
    Messages.setLanguageText(tracker_port_backup_label, CFG_PREFIX + "tracker.portbackup");

    Control[] non_ssl_controls = new Control[3];
    non_ssl_controls[0] = tracker_port.getControl();
    non_ssl_controls[1] = tracker_port_backup.getControl();
    non_ssl_controls[2] = tracker_port_backup_label;

    nonsslEnable.setAdditionalActionPerformer(new ChangeSelectionActionPerformer( non_ssl_controls ));

    // row

    final BooleanParameter sslEnable =
        new BooleanParameter(gMainTab, "Tracker Port SSL Enable",
                             CFG_PREFIX + "tracker.sslport");

    IntParameter tracker_port_ssl = new IntParameter(gMainTab,
          "Tracker Port SSL", 0, 65535);
    gridData = new GridData();
    tracker_port_ssl.setLayoutData( gridData );

    final StringParameter tracker_port_ssl_backup = new StringParameter(gMainTab, "Tracker Port SSL Backups", "" );

    gridData = new GridData();
    gridData.widthHint = 100;
    tracker_port_ssl_backup.setLayoutData( gridData );
   
    Label tracker_port_ssl_backup_label = new Label(gMainTab, SWT.NULL );
    Messages.setLanguageText(tracker_port_ssl_backup_label, CFG_PREFIX + "tracker.portbackup");

      // create cert row

    Label cert_label = new Label(gMainTab, SWT.NULL );
    Messages.setLanguageText(cert_label, CFG_PREFIX + "tracker.createcert");

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

    Messages.setLanguageText(cert_button, CFG_PREFIX + "tracker.createbutton");

    cert_button.addListener(SWT.Selection,
        new Listener()
      {
            public void
        handleEvent(Event event)
            {
              new CertificateCreatorWindow();
            }
        });
   
    Label ssl_faq_label = new Label(gMainTab, SWT.NULL);
    gridData = new GridData();
    gridData.horizontalSpan = 2;
    ssl_faq_label.setLayoutData(gridData);
    Messages.setLanguageText(ssl_faq_label, CFG_PREFIX + "tracker.sslport.info");
    final String linkFAQ = "http://plugins.vuze.com/faq.php#19";
    ssl_faq_label.setCursor(ssl_faq_label.getDisplay().getSystemCursor(SWT.CURSOR_HAND));
    ssl_faq_label.setForeground(Colors.blue);
    ssl_faq_label.addMouseListener(new MouseAdapter() {
       public void mouseDoubleClick(MouseEvent arg0) {
         Utils.launch(linkFAQ);
       }
       public void mouseDown(MouseEvent arg0) {
         Utils.launch(linkFAQ);
       }
    });
   
    Control[] ssl_controls = {  
        tracker_port_ssl.getControl(),
        tracker_port_ssl_backup.getControl(),
        tracker_port_ssl_backup_label,
        ssl_faq_label,
        cert_label,
        cert_button };

    sslEnable.setAdditionalActionPerformer(new ChangeSelectionActionPerformer( ssl_controls ));

   
    // row

    gridData = new GridData();
    gridData.horizontalSpan = 1;
    new BooleanParameter(gMainTab, "Tracker Public Enable",
                         CFG_PREFIX + "tracker.publicenable").setLayoutData( gridData );

    label = new Label(gMainTab, SWT.NULL);
    Messages.setLanguageText(label, CFG_PREFIX + "tracker.publicenable.info");
    gridData = new GridData();
    gridData.horizontalSpan = 3;
    label.setLayoutData(gridData);
   
    // row
   
    BooleanParameter forcePortDetails =
        new BooleanParameter(gMainTab,  "Tracker Port Force External",
                             CFG_PREFIX + "tracker.forceport");

    label = new Label(gMainTab, SWT.NULL);
    gridData = new GridData();
    gridData.horizontalSpan = 3;
    label.setLayoutData(gridData);
   
   
    Control[] f_controls = new Control[1];
    f_controls[0] = forcePortDetails.getControl();

    IAdditionalActionPerformer f_enabler =
      new GenericActionPerformer(f_controls) {
        public void performAction()
        {
          boolean selected =  nonsslEnable.isSelected() ||
          sslEnable.isSelected();
   
          controls[0].setEnabled( selected );
        }
      };

    nonsslEnable.setAdditionalActionPerformer(f_enabler);
    sslEnable.setAdditionalActionPerformer(f_enabler);
   
    // row
      // add announce urls to hosted torrents
    BooleanParameter hostAddURLs =
        new BooleanParameter(gMainTab,  "Tracker Host Add Our Announce URLs",
                             CFG_PREFIX + "tracker.host.addurls");
  
    gridData = new GridData();
    gridData.horizontalSpan = 2;
    hostAddURLs.setLayoutData( gridData );
   
    label = new Label(gMainTab, SWT.NULL);
    gridData = new GridData();
    gridData.horizontalSpan = 2;
    label.setLayoutData(gridData);
   
    // row

    gridData = new GridData();
    gridData.horizontalSpan = 1;
    final BooleanParameter passwordEnableWeb =
        new BooleanParameter(gMainTab, "Tracker Password Enable Web",
                             CFG_PREFIX + "tracker.passwordenableweb");
    passwordEnableWeb.setLayoutData( gridData );
   
    gridData = new GridData();
    gridData.horizontalSpan = 3;
    final BooleanParameter passwordWebHTTPSOnly =
        new BooleanParameter(gMainTab, "Tracker Password Web HTTPS Only",
                             CFG_PREFIX + "tracker.passwordwebhttpsonly");
    passwordWebHTTPSOnly.setLayoutData( gridData );

    IAdditionalActionPerformer web_https_enabler =
        new GenericActionPerformer(passwordWebHTTPSOnly.getControls())
            {
              public void performAction()
              {
                boolean selected =    passwordEnableWeb.isSelected() &&
                      sslEnable.isSelected();
 
                for (int i=0;i<controls.length;i++){
                 
                  controls[i].setEnabled( selected );
                }
              }
            };

    passwordEnableWeb.setAdditionalActionPerformer(web_https_enabler);
    sslEnable.setAdditionalActionPerformer(web_https_enabler);

    // row

     final BooleanParameter passwordEnableTorrent =
      new BooleanParameter(gMainTab, "Tracker Password Enable Torrent",
                           CFG_PREFIX + "tracker.passwordenabletorrent");
    label = new Label(gMainTab, SWT.NULL);
    Messages.setLanguageText(label, CFG_PREFIX + "tracker.passwordenabletorrent.info");
    gridData = new GridData();
    gridData.horizontalSpan = 3;
    label.setLayoutData( gridData );

     // row

    label = new Label(gMainTab, SWT.NULL);
    Messages.setLanguageText(label, CFG_PREFIX + "tracker.username");

    final StringParameter tracker_username = new StringParameter(gMainTab, "Tracker Username", "" );

    gridData = new GridData();
    gridData.widthHint = 100;
    tracker_username.setLayoutData( gridData );

    label = new Label(gMainTab, SWT.NULL);
    label = new Label(gMainTab, SWT.NULL);
     // row

    label = new Label(gMainTab, SWT.NULL);
    Messages.setLanguageText(label, CFG_PREFIX + "tracker.password");

    final PasswordParameter tracker_password = new PasswordParameter(gMainTab, "Tracker Password" );

    gridData = new GridData();
    gridData.widthHint = 100;
    tracker_password.setLayoutData( gridData );

    label = new Label(gMainTab, SWT.NULL);
    label = new Label(gMainTab, SWT.NULL);

    Control[] x_controls = new Control[2];
    x_controls[0] = tracker_username.getControl();
    x_controls[1] = tracker_password.getControl();

    IAdditionalActionPerformer enabler =
        new GenericActionPerformer(x_controls)
            {
            public void performAction()
            {
              boolean selected =  passwordEnableWeb.isSelected() ||
                        passwordEnableTorrent.isSelected();

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

                controls[i].setEnabled( selected );
              }
            }
            };

    passwordEnableWeb.setAdditionalActionPerformer(enabler);
    passwordEnableTorrent.setAdditionalActionPerformer(enabler);
   

   
      // Poll Group //
   
    Group gPollStuff = new Group(gMainTab, SWT.NULL);
    Messages.setLanguageText(gPollStuff, CFG_PREFIX + "tracker.pollinterval");
    gridData = new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL);
    gridData.horizontalSpan = 4;
    gPollStuff.setLayoutData(gridData);
    layout = new GridLayout();
    layout.numColumns = 4;
    gPollStuff.setLayout(layout);

    label = new Label(gPollStuff, SWT.NULL);
    Messages.setLanguageText(label, CFG_PREFIX + "tracker.pollintervalmin");
    gridData = new GridData();
    label.setLayoutData( gridData );

    IntParameter pollIntervalMin = new IntParameter(gPollStuff, "Tracker Poll Interval Min");

    gridData = new GridData();
    pollIntervalMin.setLayoutData( gridData );

    label = new Label(gPollStuff, SWT.NULL);
    Messages.setLanguageText(label, CFG_PREFIX + "tracker.pollintervalmax");
    gridData = new GridData();
    label.setLayoutData( gridData );

    IntParameter pollIntervalMax = new IntParameter(gPollStuff, "Tracker Poll Interval Max");

    gridData = new GridData();
    pollIntervalMax.setLayoutData( gridData );

    // row

    label = new Label(gPollStuff, SWT.NULL);
    Messages.setLanguageText(label, CFG_PREFIX + "tracker.pollintervalincby");
    gridData = new GridData();
    label.setLayoutData( gridData );

    IntParameter pollIntervalIncBy = new IntParameter(gPollStuff, "Tracker Poll Inc By");

    gridData = new GridData();
    pollIntervalIncBy.setLayoutData( gridData );

    label = new Label(gPollStuff, SWT.NULL);
    Messages.setLanguageText(label, CFG_PREFIX + "tracker.pollintervalincper");
    gridData = new GridData();
    label.setLayoutData( gridData );

    IntParameter pollIntervalIncPer = new IntParameter(gPollStuff, "Tracker Poll Inc Per");

    gridData = new GridData();
    pollIntervalIncPer.setLayoutData( gridData );

   
    // scrape + cache group

    Group gScrapeCache = new Group(gMainTab, SWT.NULL);
    Messages.setLanguageText(gScrapeCache, CFG_PREFIX + "tracker.scrapeandcache");
    gridData = new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL);
    gridData.horizontalSpan = 4;
    gScrapeCache.setLayoutData(gridData);
    layout = new GridLayout();
    layout.numColumns = 4;
    gScrapeCache.setLayout(layout);
   
    // row
   
    label = new Label(gScrapeCache, SWT.NULL);
    Messages.setLanguageText(label, CFG_PREFIX + "tracker.announcescrapepercentage");

    IntParameter scrapeannouncepercentage = new IntParameter(gScrapeCache, "Tracker Scrape Retry Percentage");

    gridData = new GridData();
    scrapeannouncepercentage.setLayoutData( gridData );
   
    label = new Label(gScrapeCache, SWT.NULL);
    Messages.setLanguageText(label, CFG_PREFIX + "tracker.scrapecacheperiod");
    gridData = new GridData();
    label.setLayoutData( gridData );

    IntParameter scrapeCachePeriod = new IntParameter(gScrapeCache, "Tracker Scrape Cache");

    gridData = new GridData();
    scrapeCachePeriod.setLayoutData( gridData );
   
    // row

    label = new Label(gScrapeCache, SWT.NULL);
    Messages.setLanguageText(label, CFG_PREFIX + "tracker.announcecacheminpeers");

    IntParameter announceCacheMinPeers = new IntParameter(gScrapeCache, "Tracker Announce Cache Min Peers");

    gridData = new GridData();
    announceCacheMinPeers.setLayoutData( gridData );
   
    label = new Label(gScrapeCache, SWT.NULL);
    Messages.setLanguageText(label, CFG_PREFIX + "tracker.announcecacheperiod");
    gridData = new GridData();
    label.setLayoutData( gridData );

    IntParameter announceCachePeriod = new IntParameter(gScrapeCache, "Tracker Announce Cache");

    gridData = new GridData();
    announceCachePeriod.setLayoutData( gridData );

   
    // main tab again
    // row

    label = new Label(gMainTab, SWT.NULL);
    Messages.setLanguageText(label, CFG_PREFIX + "tracker.maxpeersreturned");
    gridData = new GridData();
    label.setLayoutData( gridData );

    IntParameter maxPeersReturned = new IntParameter(gMainTab, "Tracker Max Peers Returned");

    gridData = new GridData();
    maxPeersReturned.setLayoutData( gridData );

    label = new Label(gMainTab, SWT.NULL);
    label = new Label(gMainTab, SWT.NULL);

      // seed retention limit
   
    label = new Label(gMainTab, SWT.NULL);
    Messages.setLanguageText(label, CFG_PREFIX + "tracker.seedretention");
    gridData = new GridData();
    label.setLayoutData( gridData );

    IntParameter seedRetentionLimit = new IntParameter(gMainTab, "Tracker Max Seeds Retained");

    gridData = new GridData();
    seedRetentionLimit.setLayoutData( gridData );

    label = new Label(gMainTab, SWT.NULL);
    Messages.setLanguageText(label, CFG_PREFIX + "tracker.seedretention.info");
    gridData = new GridData();
    gridData.horizontalSpan = 2;
    label.setLayoutData( gridData );

      // row

    gridData = new GridData();
    gridData.horizontalSpan = 2;
    new BooleanParameter(gMainTab, "Tracker NAT Check Enable",
                         CFG_PREFIX + "tracker.natcheckenable").setLayoutData( gridData );
   
    Composite gNATDetails = new Composite(gMainTab, SWT.NULL);
    gridData = new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL);
    gridData.horizontalSpan = 2;
    gNATDetails.setLayoutData(gridData);
    layout = new GridLayout();
    layout.numColumns = 2;
    layout.marginHeight=0;
    layout.marginWidth=0;
    gNATDetails.setLayout(layout);
   
      // row
   
    label = new Label(gNATDetails, SWT.NULL);
    Messages.setLanguageText(label, CFG_PREFIX + "tracker.natchecktimeout");
    gridData = new GridData();
    label.setLayoutData( gridData );

    IntParameter NATTimeout = new IntParameter(gNATDetails, "Tracker NAT Check Timeout");

    gridData = new GridData();
    NATTimeout.setLayoutData( gridData );

    // row
   
    gridData = new GridData();
    gridData.horizontalSpan = 4;
    new BooleanParameter(gMainTab, "Tracker Send Peer IDs",
                         CFG_PREFIX + "tracker.sendpeerids").setLayoutData(gridData);
   
    // row
    gridData = new GridData();
    gridData.horizontalSpan = 4;
    BooleanParameter  enable_udp =
      new BooleanParameter(gMainTab, "Tracker Port UDP Enable",
                         CFG_PREFIX + "tracker.enableudp");

    enable_udp.setLayoutData(gridData);
   
    // row
   
    Label udp_version_label = new Label(gMainTab, SWT.NULL);
    Messages.setLanguageText(udp_version_label,  CFG_PREFIX + "tracker.udpversion");
    gridData = new GridData();
    IntParameter  udp_version = new IntParameter(gMainTab, "Tracker Port UDP Version");
    udp_version.setLayoutData(gridData);
    label = new Label(gMainTab, SWT.NULL);
    label = new Label(gMainTab, SWT.NULL);

    enable_udp.setAdditionalActionPerformer(
        new ChangeSelectionActionPerformer( new Control[]{ udp_version_label, udp_version.getControl() }));

    // row
   
    gridData = new GridData();
    gridData.horizontalSpan = 4;
    new BooleanParameter(gMainTab, "Tracker Compact Enable",
                         CFG_PREFIX + "tracker.enablecompact").setLayoutData(gridData);
   
    // row

    gridData = new GridData();
    gridData.horizontalSpan = 4;
    BooleanParameter log_enable =
      new BooleanParameter(gMainTab, "Tracker Log Enable",
                         CFG_PREFIX + "tracker.logenable");
    log_enable.setLayoutData( gridData );
   
    if(userMode>1) { // XXX
   
    // row

    gridData = new GridData();
    gridData.horizontalSpan = 4;
    new BooleanParameter(gMainTab, "Tracker Key Enable Server",
                         CFG_PREFIX + "tracker.enablekey").setLayoutData(gridData);

    // Networks Group //
   
    Group networks_group = new Group( gMainTab, SWT.NULL );
    Messages.setLanguageText( networks_group, CFG_PREFIX + "tracker.server.group.networks" );
    GridData    networks_layout = new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL);
    networks_layout.horizontalSpan = 4;
    networks_group.setLayoutData( networks_layout );
    layout = new GridLayout();
    layout.numColumns = 2;
    networks_group.setLayout(layout);
       
    label = new Label(networks_group, SWT.NULL);
    Messages.setLanguageText(label, CFG_PREFIX + "tracker.server.group.networks.info");
    GridData grid_data = new GridData();
    grid_data.horizontalSpan = 2;
    label.setLayoutData( grid_data );
   
    for (int i=0;i<AENetworkClassifier.AT_NETWORKS.length;i++){
   
    String  nn = AENetworkClassifier.AT_NETWORKS[i];
 
    String  config_name = "Tracker Network Selection Default." + nn;
    String  msg_text  = CFG_PREFIX + "connection.networks." + nn;
    
    BooleanParameter network = new BooleanParameter(networks_group, config_name, msg_text );
       
      grid_data = new GridData();
      grid_data.horizontalSpan = 2;
      network.setLayoutData( grid_data );
  }
   
    // processing limits group //

    Group gProcessing = new Group(gMainTab, SWT.NULL);
    Messages.setLanguageText(gProcessing, CFG_PREFIX + "tracker.processinglimits");
    gridData = new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL);
    gridData.horizontalSpan = 4;
    gProcessing.setLayoutData(gridData);
    layout = new GridLayout();
    layout.numColumns = 3;
    gProcessing.setLayout(layout);
   
      // row annouce/scrape max process time
   
    label = new Label(gProcessing, SWT.NULL);
    Messages.setLanguageText(label, CFG_PREFIX + "tracker.maxgettime");
    gridData = new GridData();
    label.setLayoutData( gridData );

    IntParameter maxGetTime = new IntParameter(gProcessing, "Tracker Max GET Time");
    gridData = new GridData();
    maxGetTime.setLayoutData( gridData );

    label = new Label(gProcessing, SWT.NULL);
    Messages.setLanguageText(label, CFG_PREFIX + "tracker.maxgettime.info");
  
    // row post multiplier
   
    label = new Label(gProcessing, SWT.NULL);
    Messages.setLanguageText(label, CFG_PREFIX + "tracker.maxposttimemultiplier");
    gridData = new GridData();
    label.setLayoutData( gridData );

    IntParameter maxPostTimeMultiplier = new IntParameter(gProcessing, "Tracker Max POST Time Multiplier");

    gridData = new GridData();
    maxPostTimeMultiplier.setLayoutData( gridData );

    label = new Label(gProcessing, SWT.NULL);
    Messages.setLanguageText(label, CFG_PREFIX + "tracker.maxposttimemultiplier.info");
  
     // row max threads
   
    label = new Label(gProcessing, SWT.NULL);
    Messages.setLanguageText(label, CFG_PREFIX + "tracker.maxthreads");
    gridData = new GridData();
    label.setLayoutData( gridData );

    IntParameter maxThreadsTime = new IntParameter(gProcessing, "Tracker Max Threads");
    maxThreadsTime.setMinimumValue(1);
    maxThreadsTime.setMaximumValue(4096);
    gridData = new GridData();
    maxThreadsTime.setLayoutData( gridData );

    label = new Label(gProcessing, SWT.NULL);
   
   
    // non-blocking tracker group //
   
    Group gNBTracker = new Group(gMainTab, SWT.NULL);
    Messages.setLanguageText(gNBTracker, CFG_PREFIX + "tracker.nonblocking");
    gridData = new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL);
    gridData.horizontalSpan = 4;
    gNBTracker.setLayoutData(gridData);
    layout = new GridLayout();
    layout.numColumns = 3;
    gNBTracker.setLayout(layout);
   
      // row
View Full Code Here

  }


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

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

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

    final PlatformManager platform = PlatformManagerFactory.getPlatformManager();
   
      // ***** auto open group
   
    Group gAutoOpen = new Group(cDisplay, SWT.NULL);
    Messages.setLanguageText(gAutoOpen, LBLKEY_PREFIX + "autoopen");
    layout = new GridLayout(3, false);
    gAutoOpen.setLayout(layout);
    gAutoOpen.setLayoutData(new GridData( GridData.FILL_HORIZONTAL ));


    label = new Label(gAutoOpen, SWT.NULL);
    Messages.setLanguageText(label, LBLKEY_PREFIX + "autoopen.detailstab");
    new BooleanParameter(gAutoOpen, "Open Details", LBLKEY_PREFIX
        + "autoopen.dl");
    new BooleanParameter(gAutoOpen, "Open Seeding Details", LBLKEY_PREFIX
        + "autoopen.cd");


    label = new Label(gAutoOpen, SWT.NULL);
    Messages.setLanguageText(label, LBLKEY_PREFIX + "autoopen.downloadbars");
    new BooleanParameter(gAutoOpen, "Open Bar Incomplete", LBLKEY_PREFIX + "autoopen.dl");
    new BooleanParameter(gAutoOpen, "Open Bar Complete", LBLKEY_PREFIX + "autoopen.cd");
   
      // ****
   
    new BooleanParameter(cDisplay, "Remember transfer bar location", LBLKEY_PREFIX + "transferbar.remember_location");

    Group gSysTray = new Group(cDisplay, SWT.NULL);
    Messages.setLanguageText(gSysTray, LBLKEY_PREFIX + "systray");
    layout = new GridLayout();
    gSysTray.setLayout(layout);
    gSysTray.setLayoutData(new GridData( GridData.FILL_HORIZONTAL ));

    BooleanParameter est = new BooleanParameter(gSysTray, "Enable System Tray",
        KEY_PREFIX + "enabletray");

    BooleanParameter ctt = new BooleanParameter(gSysTray, "Close To Tray",
        LBLKEY_PREFIX + "closetotray");
    BooleanParameter mtt = new BooleanParameter(gSysTray, "Minimize To Tray",
        LBLKEY_PREFIX + "minimizetotray");
    BooleanParameter esttt = new BooleanParameter(gSysTray, "ui.systray.tooltip.enable",
        "ConfigView.label.enableSystrayToolTip");

    est.setAdditionalActionPerformer(new ChangeSelectionActionPerformer(
        ctt.getControls()));
    est.setAdditionalActionPerformer(new ChangeSelectionActionPerformer(
        mtt.getControls()));
    est.setAdditionalActionPerformer(new ChangeSelectionActionPerformer(
        esttt.getControls()));
   
        /**
         * Default download / upload limits available in the UI.
         */
        Group limit_group = new Group(cDisplay, SWT.NULL);
        Messages.setLanguageText(limit_group, LBLKEY_PREFIX + "set_ui_transfer_speeds");
        layout = new GridLayout();
        layout.numColumns = 2;
        limit_group.setLayout(layout);
        limit_group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
       
        Label limit_group_label = new Label(limit_group, SWT.WRAP);
        limit_group_label.setLayoutData(Utils.getWrappableLabelGridData(2, GridData.GRAB_HORIZONTAL));
        Messages.setLanguageText(limit_group_label, LBLKEY_PREFIX + "set_ui_transfer_speeds.description");
       
        String[] limit_types = new String[] {"download", "upload"};
        final String limit_type_prefix = "config.ui.speed.partitions.manual.";
        for (int i=0; i<limit_types.length; i++) {
          final BooleanParameter bp = new BooleanParameter(limit_group, limit_type_prefix + limit_types[i] + ".enabled", false, LBLKEY_PREFIX + "set_ui_transfer_speeds.description." + limit_types[i]);
          final StringParameter sp = new StringParameter(limit_group, limit_type_prefix + limit_types[i] + ".values", "");
          IAdditionalActionPerformer iaap = new GenericActionPerformer(new Control[] {}) {
            public void performAction() {
              sp.getControl().setEnabled(bp.isSelected())
            }
          };
         
            gridData = new GridData();
            gridData.widthHint = 150;
            sp.setLayoutData(gridData);
          iaap.performAction();
          bp.setAdditionalActionPerformer(iaap);
        }

    new BooleanParameter(cDisplay, "Send Version Info", LBLKEY_PREFIX
        + "allowSendVersion");

    Composite cArea = new Composite(cDisplay, SWT.NULL);
    layout = new GridLayout();
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    layout.numColumns = 2;
    cArea.setLayout(layout);
    cArea.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
   
    new LinkLabel(cArea, LBLKEY_PREFIX + "version.info.link",
        "http://wiki.vuze.com/w/Version.azureusplatform.com");

    if (!Constants.isOSX) {

      BooleanParameter confirm = new BooleanParameter(cArea,
          "confirmationOnExit",
          "ConfigView.section.style.confirmationOnExit");
      gridData = new GridData();
      gridData.horizontalSpan = 2;
      confirm.setLayoutData(gridData);
    }
   
    cArea = new Composite(cDisplay, SWT.NULL);
    layout = new GridLayout();
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    layout.numColumns = 2;
    cArea.setLayout(layout);
    cArea.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    // clear remembered decisions

    final Label clear_label = new Label(cArea, SWT.NULL);
    Messages.setLanguageText(clear_label, KEY_PREFIX + "cleardecisions");

    final Button clear_decisions = new Button(cArea, SWT.PUSH);
    Messages.setLanguageText(clear_decisions, KEY_PREFIX
        + "cleardecisionsbutton");

    clear_decisions.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event event) {

        COConfigurationManager.setParameter("MessageBoxWindow.decisions",
            new HashMap());
      }
    });

    final Label clear_tracker_label = new Label(cArea, SWT.NULL);
    Messages.setLanguageText(clear_tracker_label, KEY_PREFIX + "cleartrackers");

    final Button clear_tracker_button = new Button(cArea, SWT.PUSH);
    Messages.setLanguageText(clear_tracker_button, KEY_PREFIX
        + "cleartrackersbutton");
   
    clear_tracker_button.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event event) {
        TrackersUtil.getInstance().clearAllTrackers(true);
      }
    });
   
    final Label clear_save_path_label = new Label(cArea, SWT.NULL);
    Messages.setLanguageText(clear_save_path_label, KEY_PREFIX + "clearsavepaths");

    final Button clear_save_path_button = new Button(cArea, SWT.PUSH);
    Messages.setLanguageText(clear_save_path_button, KEY_PREFIX
        + "clearsavepathsbutton");
   
    clear_save_path_button.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event event) {
        COConfigurationManager.setParameter("saveTo_list", new StringListImpl());
      }
    });
   
    decisions_parameter_listener = new ParameterListener() {
      public void parameterChanged(String parameterName) {
        if (clear_decisions.isDisposed()) {

          // tidy up from previous incarnations

          COConfigurationManager.removeParameterListener(
              "MessageBoxWindow.decisions", this);

        } else {

          boolean enabled = COConfigurationManager.getMapParameter(
              "MessageBoxWindow.decisions", new HashMap()).size() > 0;

          clear_label.setEnabled(enabled);
          clear_decisions.setEnabled(enabled);
        }
      }
    };

    decisions_parameter_listener.parameterChanged(null);

    COConfigurationManager.addParameterListener("MessageBoxWindow.decisions",
        decisions_parameter_listener);

    // drag-drop
    /* gone to comply with whateverooo
    label = new Label(cArea, SWT.NULL);
    Messages.setLanguageText(label, "ConfigView.section.style.dropdiraction");

    String[] drop_options = {
        "ConfigView.section.style.dropdiraction.opentorrents",
        "ConfigView.section.style.dropdiraction.sharefolder",
        "ConfigView.section.style.dropdiraction.sharefoldercontents",
        "ConfigView.section.style.dropdiraction.sharefoldercontentsrecursive", };

    String dropLabels[] = new String[drop_options.length];
    String dropValues[] = new String[drop_options.length];
    for (int i = 0; i < drop_options.length; i++) {

      dropLabels[i] = MessageText.getString(drop_options[i]);
      dropValues[i] = "" + i;
    }
    new StringListParameter(cArea, "config.style.dropdiraction",
        dropLabels, dropValues);
    */
   
    // reset associations

    if (platform.hasCapability(PlatformManagerCapabilities.RegisterFileAssociations)) {

      Composite cResetAssoc = new Composite(cArea, SWT.NULL);
      layout = new GridLayout();
      layout.marginHeight = 0;
      layout.marginWidth = 0;
      layout.numColumns = 2;
      cResetAssoc.setLayout(layout);
      cResetAssoc.setLayoutData(new GridData());
View Full Code Here

   
    fillPieceInfoSection();
  }

  private Composite createPeerInfoPanel(Composite parent) {
    GridLayout layout;
    GridData gridData;

    // Peer Info section contains
    // - Peer's Block display
    // - Peer's Datarate
    pieceInfoComposite = new Composite(parent, SWT.NONE);
    layout = new GridLayout();
    layout.numColumns = 2;
    layout.horizontalSpacing = 0;
    layout.verticalSpacing = 0;
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    pieceInfoComposite.setLayout(layout);
    gridData = new GridData(GridData.FILL, GridData.FILL, true, true);
    pieceInfoComposite.setLayoutData(gridData);

    imageLabel = new Label(pieceInfoComposite, SWT.NULL);
    gridData = new GridData();
    imageLabel.setLayoutData(gridData);

    topLabel = new Label(pieceInfoComposite, SWT.NULL);
    gridData = new GridData(SWT.FILL, SWT.DEFAULT, false, false);
    topLabel.setLayoutData(gridData);

    sc = new ScrolledComposite(pieceInfoComposite, SWT.V_SCROLL);
    sc.setExpandHorizontal(true);
    sc.setExpandVertical(true);
    layout = new GridLayout();
    layout.horizontalSpacing = 0;
    layout.verticalSpacing = 0;
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    sc.setLayout(layout);
View Full Code Here

  public void configSectionDelete() {
  }

  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.numColumns = 2;
    cSection.setLayout(layout);

    int userMode = COConfigurationManager.getIntParameter("User Mode");
    if (userMode < REQUIRED_MODE) {
View Full Code Here

   */
  public void show() {
    wizard.setTitle(MessageText.getString("wizard.singlefile"));
    wizard.setCurrentInfo(MessageText.getString("wizard.choosefile"));
    Composite panel = wizard.getPanel();
    GridLayout layout = new GridLayout();
    layout.numColumns = 3;
    panel.setLayout(layout);
   
    Label label = new Label(panel, SWT.NULL);
    Messages.setLanguageText(label, "wizard.file");
View Full Code Here

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

        gridData = new GridData(GridData.VERTICAL_ALIGN_FILL|GridData.HORIZONTAL_ALIGN_FILL);
        cSection.setLayoutData(gridData);
        GridLayout subPanel = new GridLayout();
        subPanel.numColumns = 3;
        cSection.setLayout(subPanel);

        //add a comment to the debug log.
        ///////////////////////////////////
        // Comment group
        ///////////////////////////////////
        //comment grouping.
        commentGroup = new Group(cSection, SWT.NULL);
        Messages.setLanguageText(commentGroup,"ConfigTransferAutoSpeed.add.comment.to.log.group");
        GridLayout commentLayout = new GridLayout();
        commentLayout.numColumns = 3;
        commentGroup.setLayout(commentLayout);
        gridData = new GridData(GridData.FILL_HORIZONTAL);
        commentGroup.setLayoutData(gridData);

        //Label
        Label commentLabel = new Label(commentGroup,SWT.NULL);
        Messages.setLanguageText(commentLabel,"ConfigTransferAutoSpeed.add.comment.to.log");
        gridData = new GridData();
        gridData.horizontalSpan=1;
        commentLabel.setLayoutData(gridData);

        //Text-Box
        final Text commentBox = new Text(commentGroup, SWT.BORDER);
        gridData = new GridData(GridData.FILL_HORIZONTAL);
        gridData.horizontalSpan=1;
        commentBox.setText("");
        commentBox.setLayoutData(gridData);


        //button
        Button commentButton = new Button( commentGroup, SWT.PUSH);
        //Messages.
        gridData = new GridData();
        gridData.horizontalSpan=1;
        commentButton.setLayoutData(gridData);
        Messages.setLanguageText(commentButton,"ConfigTransferAutoSpeed.log.button");
        commentButton.addListener(SWT.Selection, new Listener(){
            public void handleEvent(Event event){
                //Add a file to the log.
                AEDiagnosticsLogger dLog = AEDiagnostics.getLogger("AutoSpeed");
                String comment = commentBox.getText();
                if(comment!=null){
                    if( comment.length()>0){
                        dLog.log( "user-comment:"+comment );
                        commentBox.setText("");
                    }
                }
            }
        });

        //spacer
        Label commentSpacer = new Label(cSection, SWT.NULL);
        gridData = new GridData();
        gridData.horizontalSpan=3;
        commentSpacer.setLayoutData(gridData);

               

        ///////////////////////////
        // Upload Capacity used settings.
        ///////////////////////////
        uploadCapGroup = new Group(cSection, SWT.NULL);
        Messages.setLanguageText(uploadCapGroup,"ConfigTransferAutoSpeed.upload.capacity.usage");

        GridLayout uCapLayout = new GridLayout();
        uCapLayout.numColumns = 2;
        uploadCapGroup.setLayout(uCapLayout);

        gridData = new GridData(GridData.FILL_HORIZONTAL);
        gridData.horizontalSpan = 3;
View Full Code Here

TOP

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

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.