Examples of GridData


Examples of org.eclipse.swt.layout.GridData

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

        Composite panel = new Composite(rootPanel, SWT.NULL);
        GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
        panel.setLayoutData(gridData);

        layout = new GridLayout();
        layout.numColumns = 4;
        panel.setLayout(layout);

        Label explain = new Label(panel, SWT.WRAP);
        gridData = new GridData(GridData.FILL_HORIZONTAL);
        gridData.horizontalSpan = 4;
        explain.setLayoutData(gridData);
        Messages.setLanguageText(explain,"SpeedTestWizard.set.upload.panel.explain");

        //spacer line
        Label spacer = new Label(panel, SWT.NULL);
        gridData = new GridData();
        gridData.horizontalSpan = 4;
        spacer.setLayoutData(gridData);

        Label spacer1 = new Label(panel, SWT.NULL);
        gridData = new GridData();
        spacer1.setLayoutData(gridData);

        Label bytesCol = new Label(panel, SWT.NULL);
        gridData = new GridData();
        gridData.widthHint=80;
        bytesCol.setLayoutData(gridData);
        Messages.setLanguageText(bytesCol,"SpeedTestWizard.set.upload.bytes.per.sec");

        Label bitsCol = new Label(panel, SWT.NULL);
        gridData = new GridData();
        gridData.widthHint=80;
        bitsCol.setLayoutData(gridData);
        Messages.setLanguageText(bitsCol,"SpeedTestWizard.set.upload.bits.per.sec");

        Label confLevel = new Label(panel, SWT.NULL);
        gridData = new GridData();
        gridData.widthHint=80;
        confLevel.setLayoutData(gridData);
        Messages.setLanguageText(confLevel,"SpeedTestWizard.set.limit.conf.level");

        //upload limit label.
        Label ul = new Label(panel, SWT.NULL );
        gridData = new GridData();
        ul.setLayoutData(gridData);
        Messages.setLanguageText(
            ul,
                "SpeedView.stats.estupcap",
                new String[] { DisplayFormatters.getRateUnit(DisplayFormatters.UNIT_KB)});

        final Text uploadLimitSetting = new Text(panel, SWT.BORDER );
        gridData = new GridData(GridData.BEGINNING);
        gridData.widthHint=80;
        uploadLimitSetting.setLayoutData(gridData);

        int uploadCapacity = determineRateSettingEx(measuredUploadKbps,uploadTestRan,true);

        //don't accept any value less the 20 kb/s
        if(uploadCapacity<20)
            uploadCapacity=20;

        uploadLimitSetting.setText( ""+uploadCapacity );
        uploadLimitSetting.addListener(SWT.Verify, new NumberListener(uploadLimitSetting));


        //echo
        final Label echo = new Label(panel, SWT.NULL);
        gridData = new GridData();
        gridData.horizontalSpan = 1;
        gridData.widthHint = 80;
        echo.setLayoutData(gridData);
        echo.setText( DisplayFormatters.formatByteCountToBitsPerSec(uploadCapacity*1024) );
        //This space has a change listener the updates in bits/sec.

        //want a change listener to update the echo label which has the value in bits/sec.
        uploadLimitSetting.addListener(SWT.Modify, new ByteConversionListener(echo,uploadLimitSetting));

        //confidence setting.
        final String[] confName = helper.getSettableTypes();
        final String[] confValue = helper.getSettableTypes();

        //upload confidence setting.
        int uploadDropIndex = setDefaultConfidenceLevelEx(measuredUploadKbps,uploadTestRan,true,confValue);
        upConfLevelCombo = new Combo(panel, SWT.READ_ONLY );
        addDropElements(upConfLevelCombo,confName);
        upConfLevelCombo.select(uploadDropIndex);


        //download limit label.
        Label dl = new Label( panel, SWT.NULL );
        gridData = new GridData();
        dl.setLayoutData(gridData);
        Messages.setLanguageText(
                dl,
                "SpeedView.stats.estdowncap",
                new String[] { DisplayFormatters.getRateUnit(DisplayFormatters.UNIT_KB)});

        final Text downloadLimitSetting = new Text(panel, SWT.BORDER);
        gridData = new GridData(GridData.BEGINNING);
        gridData.widthHint=80;
        downloadLimitSetting.setLayoutData(gridData);

        int bestDownloadSetting = determineRateSettingEx(measuredDownloadKbps,downloadTestRan,false);

        downloadLimitSetting.setText( ""+bestDownloadSetting );
        downloadLimitSetting.addListener(SWT.Verify, new NumberListener(downloadLimitSetting) );

        //echo
        final Label downEcho = new Label(panel, SWT.NULL);
        gridData = new GridData();
        gridData.horizontalSpan = 1;
        gridData.widthHint = 80;
        downEcho.setLayoutData(gridData);
        downEcho.setText( DisplayFormatters.formatByteCountToBitsPerSec(bestDownloadSetting*1024) );

        //convert bytes to bits on the fly for user.
        downloadLimitSetting.addListener(SWT.Modify, new ByteConversionListener(downEcho, downloadLimitSetting) );
        int downIndex = setDefaultConfidenceLevelEx(measuredDownloadKbps,downloadTestRan,false,confValue);

        downConfLevelCombo = new Combo(panel, SWT.READ_ONLY );
        addDropElements(downConfLevelCombo,confName);
        downConfLevelCombo.select(downIndex);

        //spacer col
        Label c1 = new Label(panel, SWT.NULL);
        gridData = new GridData();
        gridData.horizontalSpan = 1;
        gridData.widthHint = 80;
        c1.setLayoutData(gridData);

        SpeedManager sm = AzureusCoreFactory.getSingleton().getSpeedManager();

        if ( uploadTestRan ){

            //Since cable modems can over estimate upload need to drop type setting to estimate.
            sm.setEstimatedUploadCapacityBytesPerSec(
              measuredUploadKbps*1024,
              uploadHitLimit?
                SpeedManagerLimitEstimate.TYPE_ESTIMATED :SpeedManagerLimitEstimate.TYPE_ESTIMATED);
        }

        if ( downloadTestRan ){
         
          sm.setEstimatedDownloadCapacityBytesPerSec(
              measuredDownloadKbps*1024,
              downloadHitLimit?
                SpeedManagerLimitEstimate.TYPE_MEASURED_MIN :SpeedManagerLimitEstimate.TYPE_MEASURED);
        }

        apply = new Button(panel, SWT.PUSH);
        Messages.setLanguageText(apply, "SpeedTestWizard.set.upload.button.apply" );
        gridData = new GridData();
        gridData.widthHint = 70;
        apply.setLayoutData(gridData);
        apply.addListener(SWT.Selection, new Listener(){
            public void handleEvent(Event event){

                //Turn the string into an int and make it kbps.
                int uploadLimitKBPS = Integer.parseInt( uploadLimitSetting.getText() );
                int downlaodLimitKBPS = Integer.parseInt( downloadLimitSetting.getText() );
                //No value less then 20 kpbs should be allowed.
                if(uploadLimitKBPS<20){
                    uploadLimitKBPS=20;
                }

                //download value can never be less then upload.
                if( downlaodLimitKBPS < uploadLimitKBPS ){
                    downlaodLimitKBPS = uploadLimitKBPS;
                }

                //set upload limits
                COConfigurationManager.setParameter( "AutoSpeed Max Upload KBs", uploadLimitKBPS );
                COConfigurationManager.setParameter( TransferSpeedValidator.UPLOAD_CONFIGKEY, uploadLimitKBPS );
                COConfigurationManager.setParameter( TransferSpeedValidator.UPLOAD_SEEDING_CONFIGKEY , uploadLimitKBPS );
                // - Do we set these?
                //COConfigurationManager.setParameter( TransferSpeedValidator.DOWNLOAD_CONFIGKEY, downlaodLimitKBPS );

                if(downloadTestRan){
                    int dIndex = downConfLevelCombo.getSelectionIndex();
                    float downEstType = helper.textToType( confValue[dIndex] );
                    speedManager.setEstimatedUploadCapacityBytesPerSec( downlaodLimitKBPS , downEstType );
                }
                if(uploadTestRan){
                    int uIndex = upConfLevelCombo.getSelectionIndex();
                    float upEstType = helper.textToType( confValue[uIndex] );
                    speedManager.setEstimatedUploadCapacityBytesPerSec( uploadLimitKBPS , upEstType );
                }

                wizard.setFinishEnabled(true);
                wizard.setPreviousEnabled(false);
            }
        });


        //spacer col
        Label c3 = new Label(panel, SWT.NULL);
        gridData = new GridData();
        gridData.horizontalSpan = 1;
        c3.setLayoutData(gridData);

        //spacer line
        Label spacer2 = new Label(panel, SWT.NULL);
        gridData = new GridData();
        gridData.horizontalSpan = 3;
        spacer2.setLayoutData(gridData);

        //switch column width to 5 columns.
        Composite resultsPanel = new Composite(rootPanel, SWT.NULL);
        gridData = new GridData( GridData.VERTICAL_ALIGN_END | GridData.FILL_HORIZONTAL );
        resultsPanel.setLayoutData(gridData);

        layout = new GridLayout();
        layout.numColumns = 5;
        layout.makeColumnsEqualWidth=true;
View Full Code Here

Examples of org.eclipse.swt.layout.GridData

     * occured in the test then the units are not printed out.
     * @param panel -
     * @param hadError - true if the test had an error.
     */
    private void createResultLabels(Composite panel,boolean hadError){
        GridData gridData;

        //spacer column
        Label c1 = new Label(panel, SWT.NULL);
        gridData = new GridData();
        gridData.horizontalSpan = 1;
        c1.setLayoutData(gridData);

        //label
        Label c2 = new Label(panel, SWT.NULL);
        gridData = new GridData();
        gridData.horizontalSpan = 1;
        gridData.horizontalAlignment = GridData.END;
        c2.setLayoutData(gridData);
        c2.setText( MessageText.getString("SpeedTestWizard.set.upload.result") );


        //bytes
        Label c3 = new Label(panel, SWT.NULL);
        gridData = new GridData();
        gridData.horizontalSpan = 1;
        gridData.horizontalAlignment = GridData.CENTER;
        c3.setLayoutData(gridData);
        if(!hadError){
            c3.setText( MessageText.getString("SpeedTestWizard.set.upload.bytes.per.sec") );
        }

        //bits
        Label c4 = new Label(panel, SWT.NULL);
        gridData = new GridData();
        gridData.horizontalSpan = 1;
        gridData.horizontalAlignment = GridData.CENTER;
        c4.setLayoutData(gridData);
        if(!hadError){
            c4.setText( MessageText.getString("SpeedTestWizard.set.upload.bits.per.sec") );
        }

        //spacer column
        Label c5 = new Label(panel, SWT.NULL);
        gridData = new GridData();
        gridData.horizontalSpan = 1;
        c5.setLayoutData(gridData);

    }
View Full Code Here

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

    new BooleanParameter(cSection, "Show Download Basket", MSG_PREFIX
        + "showdownloadbasket");

    if (!isAZ3) {
      new BooleanParameter(cSection, "IconBar.enabled", MSG_PREFIX
          + "showiconbar");
    }

    Group cStatusBar = new Group(cSection, SWT.NULL);
    Messages.setLanguageText(cStatusBar, MSG_PREFIX + "status");
    layout = new GridLayout();
    layout.numColumns = 1;
    cStatusBar.setLayout(layout);
    cStatusBar.setLayoutData(new GridData());

    new BooleanParameter(cStatusBar, "Status Area Show SR", MSG_PREFIX  + "status.show_sr");
    new BooleanParameter(cStatusBar, "Status Area Show NAT",  MSG_PREFIX + "status.show_nat");
    new BooleanParameter(cStatusBar, "Status Area Show DDB", MSG_PREFIX + "status.show_ddb");
    new BooleanParameter(cStatusBar, "Status Area Show IPF", MSG_PREFIX + "status.show_ipf");
    new BooleanParameter(cStatusBar, "status.rategraphs", MSG_PREFIX + "status.show_rategraphs");
   
    new BooleanParameter(cSection, "Add URL Silently", MSG_PREFIX  + "addurlsilently");

    new BooleanParameter(cSection, "suppress_file_download_dialog", "ConfigView.section.interface.display.suppress.file.download.dialog");

    new BooleanParameter(cSection, "show_torrents_menu", "Menu.show.torrent.menu");

    if (Constants.isWindowsXP) {
      final Button enableXPStyle = new Button(cSection, SWT.CHECK);
      Messages.setLanguageText(enableXPStyle, MSG_PREFIX + "enableXPStyle");

      boolean enabled = false;
      boolean valid = false;
      try {
        File f = new File(System.getProperty("java.home")
            + "\\bin\\javaw.exe.manifest");
        if (f.exists()) {
          enabled = true;
        }
        f = FileUtil.getApplicationFile("javaw.exe.manifest");
        if (f.exists()) {
          valid = true;
        }
      } catch (Exception e) {
        Debug.printStackTrace(e);
        valid = false;
      }
      enableXPStyle.setEnabled(valid);
      enableXPStyle.setSelection(enabled);
      enableXPStyle.addListener(SWT.Selection, new Listener() {
        public void handleEvent(Event arg0) {
          //In case we enable the XP Style
          if (enableXPStyle.getSelection()) {
            try {
              File fDest = new File(System.getProperty("java.home")
                  + "\\bin\\javaw.exe.manifest");
              File fOrigin = new File("javaw.exe.manifest");
              if (!fDest.exists() && fOrigin.exists()) {
                FileUtil.copyFile(fOrigin, fDest);
              }
            } catch (Exception e) {
              Debug.printStackTrace(e);
            }
          } else {
            try {
              File fDest = new File(System.getProperty("java.home")
                  + "\\bin\\javaw.exe.manifest");
              fDest.delete();
            } catch (Exception e) {
              Debug.printStackTrace(e);
            }
          }
        }
      });
    }

    if (Constants.isOSX) {
      new BooleanParameter(cSection, "enable_small_osx_fonts", MSG_PREFIX
          + "osx_small_fonts");
    }

    if (userMode > 0) {
      Group cUnits = new Group(cSection, SWT.NULL);
      Messages.setLanguageText(cUnits, MSG_PREFIX + "units");
      layout = new GridLayout();
      layout.numColumns = 1;
      cUnits.setLayout(layout);
      cUnits.setLayoutData(new GridData());

      new BooleanParameter(cUnits, "config.style.useSIUnits", MSG_PREFIX
          + "useSIUnits");

      new BooleanParameter(cUnits, "config.style.forceSIValues", MSG_PREFIX
          + "forceSIValues");

      new BooleanParameter(cUnits, "config.style.useUnitsRateBits", MSG_PREFIX
          + "useUnitsRateBits");

      new BooleanParameter(cUnits, "config.style.doNotUseGB", MSG_PREFIX
          + "doNotUseGB");

      new BooleanParameter(cUnits, "config.style.dataStatsOnly", MSG_PREFIX
          + "dataStatsOnly");

      new BooleanParameter(cUnits, "config.style.separateProtDataStats",
          MSG_PREFIX + "separateProtDataStats");
    }
   
    if( userMode > 1 ) {
      final BooleanParameter fMoz = new BooleanParameter(cSection, "swt.forceMozilla",MSG_PREFIX + "forceMozilla");
      Composite pArea = new Composite(cSection,SWT.NULL);
      pArea.setLayout(new GridLayout(3,false));
      pArea.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
      Messages.setLanguageText(new Label(pArea,SWT.NONE), MSG_PREFIX+"xulRunnerPath");
      final Parameter xulDir = new DirectoryParameter(pArea, "swt.xulRunner.path","");
      fMoz.setAdditionalActionPerformer(new ChangeSelectionActionPerformer(xulDir.getControls(), false));
    }
   
    Composite cArea = new Composite(cSection, SWT.NULL);
    layout = new GridLayout();
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    layout.numColumns = 2;
    cArea.setLayout(layout);
    cArea.setLayoutData(new GridData());
   
    label = new Label(cArea, 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(cArea, "GUI Refresh", 1000, labels, values);
   
    label = new Label(cArea, SWT.NULL);
    Messages.setLanguageText(label, MSG_PREFIX + "inactiveUpdate");
    gridData = new GridData();
    IntParameter inactiveUpdate = new IntParameter(cArea, "Refresh When Inactive", 1,  -1);
    inactiveUpdate.setLayoutData(gridData);

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

   
    // Reuse the labels of the other menu actions.
    if (PlatformManagerFactory.getPlatformManager().hasCapability(PlatformManagerCapabilities.ShowFileInBrowser)) {
      BooleanParameter bp = new BooleanParameter(cSection, "MyTorrentsView.menu.show_parent_folder_enabled", MSG_PREFIX
          + "use_show_parent_folder");
      Messages.setLanguageText(bp.getControl(), "ConfigView.section.style.use_show_parent_folder", new String[] {
        MessageText.getString("MyTorrentsView.menu.open_parent_folder"),
        MessageText.getString("MyTorrentsView.menu.explore"),
      });
     
      if (Constants.isOSX) {
        new BooleanParameter(cSection, "FileBrowse.usePathFinder",
            MSG_PREFIX + "usePathFinder");
      }
    }
   
    if ( Constants.isOSX_10_5_OrHigher ){
     
      Composite cSWT = new Composite(cSection, SWT.NULL);
      layout = new GridLayout();
      layout.marginHeight = 0;
      layout.marginWidth = 0;
      layout.numColumns = 2;
      cSWT.setLayout(layout);
      cSWT.setLayoutData(new GridData());
     
      label = new Label(cSWT, SWT.NULL);
      label.setText( "SWT Library" );
      String[] swtLibraries = { "carbon", "cocoa" };
         
View Full Code Here

Examples of org.eclipse.swt.layout.GridData

  public void configSectionDelete() {
  }

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

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

    gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL + GridData.VERTICAL_ALIGN_FILL);
    cSection.setLayoutData(gridData);
    GridLayout advanced_layout = new GridLayout();
    cSection.setLayout(advanced_layout);

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

      final String[] modeKeys = { "ConfigView.section.mode.beginner",
          "ConfigView.section.mode.intermediate",
          "ConfigView.section.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 cSection;
    }
   
    new LinkLabel(cSection, gridData, CFG_PREFIX
        + "info.link", MessageText.getString(CFG_PREFIX + "url"));

    ///////////////////////   ADVANCED SOCKET SETTINGS GROUP //////////
   
    Group gSocket = new Group(cSection, SWT.NULL);
    Messages.setLanguageText(gSocket, CFG_PREFIX + "socket.group");
    gridData = new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.FILL_HORIZONTAL);
    gSocket.setLayoutData(gridData);
    GridLayout glayout = new GridLayout();
    glayout.numColumns = 2;
    gSocket.setLayout(glayout);

      // max simultaneous
   
    Label lmaxout = new Label(gSocket, SWT.NULL);
    Messages.setLanguageText(lmaxout, "ConfigView.section.connection.network.max.simultaneous.connect.attempts");
    gridData = new GridData();
    lmaxout.setLayoutData( gridData );

    IntParameter max_connects = new IntParameter(gSocket,
        "network.max.simultaneous.connect.attempts", 1, 100);   
    gridData = new GridData();
    max_connects.setLayoutData(gridData);

      // // max pending
   
    Label lmaxpout = new Label(gSocket, SWT.NULL);
    Messages.setLanguageText(lmaxpout, "ConfigView.section.connection.network.max.outstanding.connect.attempts");
    gridData = new GridData();
    lmaxpout.setLayoutData( gridData );

    IntParameter max_pending_connects = new IntParameter(gSocket,
        "network.tcp.max.connections.outstanding", 1, 65536 );   
    gridData = new GridData();
    max_pending_connects.setLayoutData(gridData);
   
   

      // bind ip
   
    Label lbind = new Label(gSocket, SWT.NULL);
    Messages.setLanguageText(lbind, "ConfigView.label.bindip" );
    lbind.setLayoutData(new GridData());
   
    StringParameter bindip = new StringParameter(gSocket, "Bind IP", "", false);
    gridData = new GridData();
    gridData.widthHint = 100;
    bindip.setLayoutData(gridData);

    Text lbind2 = new Text(gSocket, SWT.READ_ONLY | SWT.MULTI);
    lbind2.setTabs(8);
    Messages.setLanguageText(
        lbind2,
        "ConfigView.label.bindip.details",
        new String[] {NetworkAdmin.getSingleton().getNetworkInterfacesAsString() });
    gridData = new GridData();
    gridData.horizontalSpan = 2;
    lbind2.setLayoutData(gridData);


    Label lpbind = new Label(gSocket, SWT.NULL);
    Messages.setLanguageText(lpbind, CFG_PREFIX + "bind_port");
    final IntParameter port_bind = new IntParameter(gSocket,
        "network.bind.local.port", 0, 65535);
    gridData = new GridData();
    port_bind.setLayoutData(gridData);
   
   
    Label lmtu = new Label(gSocket, SWT.NULL);
    Messages.setLanguageText(lmtu, CFG_PREFIX + "mtu");
    final IntParameter mtu_size = new IntParameter(gSocket,"network.tcp.mtu.size");
    mtu_size.setMaximumValue(512 * 1024);
    gridData = new GridData();
    mtu_size.setLayoutData(gridData);


    Label lsend = new Label(gSocket, SWT.NULL);
    Messages.setLanguageText(lsend, CFG_PREFIX + "SO_SNDBUF");
    final IntParameter SO_SNDBUF = new IntParameter(gSocket,  "network.tcp.socket.SO_SNDBUF");
    gridData = new GridData();
    SO_SNDBUF.setLayoutData(gridData);


    Label lreceiv = new Label(gSocket, SWT.NULL);
    Messages.setLanguageText(lreceiv, CFG_PREFIX + "SO_RCVBUF");
    final IntParameter SO_RCVBUF = new IntParameter(gSocket,  "network.tcp.socket.SO_RCVBUF");
    gridData = new GridData();
    SO_RCVBUF.setLayoutData(gridData);
   

    Label ltos = new Label(gSocket, SWT.NULL);
    Messages.setLanguageText(ltos, CFG_PREFIX + "IPDiffServ");
    final StringParameter IPDiffServ = new StringParameter(gSocket,  "network.tcp.socket.IPDiffServ");
    gridData = new GridData();
    gridData.widthHint = 100;
    IPDiffServ.setLayoutData(gridData);


    //do simple input verification, and registry key setting for TOS field
    IPDiffServ.addChangeListener(new ParameterChangeAdapter() {

      final Color obg = IPDiffServ.getControl().getBackground();

      final Color ofg = IPDiffServ.getControl().getForeground();

      public void parameterChanged(Parameter p, boolean caused_internally) {
        String raw = IPDiffServ.getValue();
        int value = -1;

        try {
          value = Integer.decode(raw).intValue();
        } catch (Throwable t) {
        }

        if (value < 0 || value > 255) { //invalid or no value entered
          ConfigurationManager.getInstance().removeParameter"network.tcp.socket.IPDiffServ");

          if (raw != null && raw.length() > 0) { //error state
            IPDiffServ.getControl().setBackground(Colors.red);
            IPDiffServ.getControl().setForeground(Colors.white);
          } else { //no value state
            IPDiffServ.getControl().setBackground(obg);
            IPDiffServ.getControl().setForeground(ofg);
          }

          enableTOSRegistrySetting(false); //disable registry setting if necessary
        } else { //passes test
          IPDiffServ.getControl().setBackground(obg);
          IPDiffServ.getControl().setForeground(ofg);

          enableTOSRegistrySetting(true); //enable registry setting if necessary
        }
      }
    });
   
      // read select
   
    Label lreadsel = new Label(gSocket, SWT.NULL);
    Messages.setLanguageText(lreadsel, CFG_PREFIX + "read_select", new String[]{ String.valueOf( COConfigurationManager.getDefault("network.tcp.read.select.time"))});
    final IntParameter read_select = new IntParameter(gSocket,  "network.tcp.read.select.time", 10, 250);
    gridData = new GridData();
    read_select.setLayoutData(gridData);
   
    Label lreadselmin = new Label(gSocket, SWT.NULL);
    Messages.setLanguageText(lreadselmin, CFG_PREFIX + "read_select_min", new String[]{ String.valueOf( COConfigurationManager.getDefault("network.tcp.read.select.min.time"))});
    final IntParameter read_select_min = new IntParameter(gSocket,  "network.tcp.read.select.min.time", 0, 100 );
    gridData = new GridData();
    read_select_min.setLayoutData(gridData);

      // write select
       
    Label lwritesel = new Label(gSocket, SWT.NULL);
    Messages.setLanguageText(lwritesel, CFG_PREFIX + "write_select", new String[]{ String.valueOf( COConfigurationManager.getDefault("network.tcp.write.select.time"))});
    final IntParameter write_select = new IntParameter(gSocket,  "network.tcp.write.select.time", 10, 250);
    gridData = new GridData();
    write_select.setLayoutData(gridData);
   
    Label lwriteselmin = new Label(gSocket, SWT.NULL);
    Messages.setLanguageText(lwriteselmin, CFG_PREFIX + "write_select_min", new String[]{ String.valueOf( COConfigurationManager.getDefault("network.tcp.write.select.min.time"))});
    final IntParameter write_select_min = new IntParameter(gSocket,  "network.tcp.write.select.min.time", 0, 100 );
    gridData = new GridData();
    write_select_min.setLayoutData(gridData);

    new BooleanParameter( cSection, "IPV6 Enable Support", "network.ipv6.enable.support"  );

   
View Full Code Here

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

Examples of org.eclipse.swt.layout.GridData

  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

Examples of org.eclipse.swt.layout.GridData

    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

Examples of org.eclipse.swt.layout.GridData

  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

Examples of org.eclipse.swt.layout.GridData

    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

Examples of org.eclipse.swt.layout.GridData

    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
TOP
Copyright © 2018 www.massapi.com. 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.