Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.Label


    cSection.setLayout(advanced_layout);

    int userMode = COConfigurationManager.getIntParameter("User Mode");

   
    Label linfo = new Label(cSection, SWT.WRAP);
    Messages.setLanguageText( linfo, CFG_PREFIX + "info" );
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    gridData.horizontalSpan = 2;
    linfo.setLayoutData(gridData);
   
    gridData = new GridData();
    gridData.horizontalSpan = 2;
    new LinkLabel(cSection, gridData, "ConfigView.label.please.visit.here",
        "http://wiki.vuze.com/w/Auto_Speed");

   
    String[]  units = { DisplayFormatters.getRateUnit( DisplayFormatters.UNIT_KB )};

      // min up
   
    Label llmux = new Label(cSection, SWT.NULL);
    Messages.setLanguageText( llmux, CFG_PREFIX + "minupload", units );
    IntParameter min_upload = new IntParameter(cSection,
        "AutoSpeed Min Upload KBs");
    gridData = new GridData();
    min_upload.setLayoutData(gridData);
   
      // max up
   
    Label llmdx = new Label(cSection, SWT.NULL);
    Messages.setLanguageText( llmdx, CFG_PREFIX + "maxupload", units );
    IntParameter max_upload = new IntParameter(cSection,
        "AutoSpeed Max Upload KBs");
    gridData = new GridData();
    max_upload.setLayoutData(gridData);

       
        if ( userMode > 0 ){
     
      BooleanParameter enable_down_adj = new BooleanParameter(
          cSection, "AutoSpeed Download Adj Enable",
          CFG_PREFIX + "enabledownadj" );
      gridData = new GridData();
      gridData.horizontalSpan = 2;
      enable_down_adj.setLayoutData(gridData);

     
      Label label = new Label(cSection, SWT.NULL);
      Messages.setLanguageText( label, CFG_PREFIX + "downadjratio" );
     
      FloatParameter down_adj = new FloatParameter( cSection, "AutoSpeed Download Adj Ratio", 0, Float.MAX_VALUE, false, );
      gridData = new GridData();
      down_adj.setLayoutData(gridData);
     

      enable_down_adj.setAdditionalActionPerformer(
            new ChangeSelectionActionPerformer( new Control[]{ down_adj.getControl()}));
    }
   
    if ( userMode > 1 ){
     
        // max inc
     
      Label label = new Label(cSection, SWT.NULL);
      Messages.setLanguageText( label, CFG_PREFIX + "maxinc", units );
     
      final IntParameter max_increase = new IntParameter(cSection,
          "AutoSpeed Max Increment KBs");
      gridData = new GridData();
      max_increase.setLayoutData(gridData);
     
        // max dec
     
      label = new Label(cSection, SWT.NULL);
      Messages.setLanguageText( label, CFG_PREFIX + "maxdec", units );
     
      final IntParameter max_decrease = new IntParameter(cSection,
          "AutoSpeed Max Decrement KBs");
      gridData = new GridData();
      max_decrease.setLayoutData(gridData);
     

        // choking ping
     
      label = new Label(cSection, SWT.NULL);
      Messages.setLanguageText( label, CFG_PREFIX + "chokeping" );

      final IntParameter choke_ping = new IntParameter(cSection,
          "AutoSpeed Choking Ping Millis");
      gridData = new GridData();
      choke_ping.setLayoutData(gridData);
     
        // forced min
     
      label = new Label(cSection, SWT.NULL);
      Messages.setLanguageText( label, CFG_PREFIX + "forcemin", units );
     
      final IntParameter forced_min = new IntParameter(cSection,
          "AutoSpeed Forced Min KBs");
      gridData = new GridData();
      forced_min.setLayoutData(gridData);

        // latency
     
      label = new Label(cSection, SWT.NULL);
      Messages.setLanguageText( label, CFG_PREFIX + "latencyfactor" );

      final IntParameter latency_factor = new IntParameter(cSection,
          "AutoSpeed Latency Factor", 1, Integer.MAX_VALUE);
      gridData = new GridData();
      latency_factor.setLayoutData(gridData);

        Label reset_label = new Label(cSection, SWT.NULL );
        Messages.setLanguageText(reset_label, CFG_PREFIX + "reset");

        Button reset_button = new Button(cSection, SWT.PUSH);

        Messages.setLanguageText(reset_button, CFG_PREFIX + "reset.button" );
View Full Code Here


      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" );
   
    Button reset_button = new Button(gReset, SWT.PUSH);

    Messages.setLanguageText(reset_button, "Button.reset" );

    reset_button.addListener(SWT.Selection,
    new Listener()
    {
          public void
      handleEvent(Event event)
          {
            MessageBoxShell mb = new MessageBoxShell(
                SWT.ICON_WARNING | SWT.OK | SWT.CANCEL,
                MessageText.getString("resetconfig.warn.title"),
                MessageText.getString("resetconfig.warn"));
           
            mb.setDefaultButtonUsingStyle(SWT.CANCEL);
           
            mb.setParent(parent.getShell());

            mb.open(
              new UserPrompterResultListener()
              {
                public void
                prompterClosed(
                  int returnVal )
                {
              if (returnVal != SWT.OK) {
                return;
              }

              COConfigurationManager.resetToDefaults();
                }
              });
          }
      });
   
    padding = new Label(gReset, SWT.NULL );
    gridData = new GridData();
    padding.setLayoutData( gridData );
   
    return cMode;
  }
View Full Code Here

  }

  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) {
      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;
    }

    // locale decoder
    label = new Label(cSection, SWT.NULL);
    Messages.setLanguageText(label, "ConfigView.section.file.decoder.label");

    LocaleUtilDecoder[] decoders = LocaleUtil.getSingleton().getDecoders();

    String decoderLabels[] = new String[decoders.length + 1];
View Full Code Here

          /* Ignore for Pre 3.0 SWT.. */
        }
        toolTipShell.setLayout(f);
        toolTipShell.setBackground(d.getSystemColor(SWT.COLOR_INFO_BACKGROUND));

        toolTipLabel = new Label(toolTipShell, SWT.WRAP);
        toolTipLabel.setForeground(d.getSystemColor(SWT.COLOR_INFO_FOREGROUND));
        toolTipLabel.setBackground(d.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
        //toolTipShell.setData("TableCellSWT", item);
        toolTipLabel.setText(sToolTip.replaceAll("&", "&&"));
        // compute size on label instead of shell because label
View Full Code Here

    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");
   
    file = new Text(panel, SWT.BORDER);
    file.addModifyListener(new ModifyListener() {
      /*
       * (non-Javadoc)
       *
       * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
       */
      public void modifyText(ModifyEvent arg0) {
        String fName = file.getText();
        ((NewTorrentWizard) wizard).singlePath = fName;
        String error = "";
        if (!fName.equals("")) {
          File f = new File(file.getText());
          if (!f.exists() || f.isDirectory()) {
            error = MessageText.getString("wizard.invalidfile");
          }else{          
            String  parent = f.getParent();
           
            if ( parent != null ){
             
              ((NewTorrentWizard) wizard).setDefaultOpenDir( parent );
            }
          }
        }
        wizard.setErrorMessage(error);
        wizard.setNextEnabled(!((NewTorrentWizard) wizard).singlePath.equals("") && error.equals(""));
      }
    });
    file.setText(((NewTorrentWizard) wizard).singlePath);
    GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
    file.setLayoutData(gridData);
   
    Button browse = new Button(panel, SWT.PUSH);
    browse.addListener(SWT.Selection, new Listener() {
      /*
       * (non-Javadoc)
       *
       * @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
       */
      public void handleEvent(Event arg0) {
        FileDialog fd = new FileDialog(wizard.getWizardWindow());
        if (wizard.getErrorMessage().equals("") && !((NewTorrentWizard) wizard).singlePath.equals("")) {
          fd.setFileName(((NewTorrentWizard) wizard).singlePath);
        }else{
          String  def = ((NewTorrentWizard) wizard).getDefaultOpenDir();
         
          if ( def.length() > 0 & new File(def).isDirectory() ){
           
            fd.setFilterPath( def );
          }
        }
        String f = fd.open();
        if (f != null){
            file.setText(f);
           
            File  ff = new File(f);
           
            String  parent = ff.getParent();
           
            if ( parent != null ){
             
              ((NewTorrentWizard) wizard).setDefaultOpenDir( parent );
            }
          }

      }
    });
    Messages.setLanguageText(browse, "wizard.browse");

    label = new Label(panel, SWT.NULL);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    gridData.horizontalSpan = 3;
    label.setLayoutData(gridData);
    label.setText("\n");

    label = new Label(panel, SWT.NULL);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    gridData.horizontalSpan = 3;
    label.setLayoutData(gridData);
    label.setForeground(Colors.blue);
    Messages.setLanguageText(label, "wizard.hint.file");
  }
View Full Code Here

    advanced_layout.numColumns = 2;
    cSection.setLayout(advanced_layout);

    int userMode = COConfigurationManager.getIntParameter("User Mode");
    if (userMode < REQUIRED_MODE) {
      Label 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",
          "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;
    }

   
    BooleanParameter enable_lan = new BooleanParameter(
        cSection, "LAN Speed Enabled",
        CFG_PREFIX + "enable" );
    gridData = new GridData();
    gridData.horizontalSpan = 2;
    enable_lan.setLayoutData(gridData);
   
    IntParameter lan_max_upload = new IntParameter( cSection, "Max LAN Upload Speed KBs" );
    gridData = new GridData();
    lan_max_upload.setLayoutData(gridData);
    Label llmux = new Label(cSection, SWT.NULL);
    Messages.setLanguageText( llmux, CFG_PREFIX + "uploadrate" );
   
   
    IntParameter lan_max_download = new IntParameter( cSection, "Max LAN Download Speed KBs" );
    gridData = new GridData();
    lan_max_download.setLayoutData(gridData);
    Label llmdx = new Label(cSection, SWT.NULL);
    Messages.setLanguageText( llmdx, CFG_PREFIX + "downloadrate" );
   
    enable_lan.setAdditionalActionPerformer(
          new ChangeSelectionActionPerformer( new Parameter[]{ lan_max_upload, lan_max_download } ));
    enable_lan.setAdditionalActionPerformer(
View Full Code Here

    gLayout.marginWidth = 0;
    gLayout.verticalSpacing = 0;
    gLayout.horizontalSpacing = 0;
    setLayout(gLayout);

    titleLabel = new Label(this, SWT.NONE);

    if ((this.style & SHOW_SEPARATOR) != 0) {
      Label separator = new Label(this, SWT.SEPARATOR | SWT.HORIZONTAL);
      GridData labelData = new GridData(SWT.FILL, SWT.CENTER, true, false);
      labelData.horizontalIndent = 10;
      separator.setLayoutData(labelData);
    }

    if ((this.style & SHOW_DESCRIPTION) != 0) {
      descriptionLabel = new Label(this, SWT.WRAP);
      GridData labelData = new GridData(SWT.FILL, SWT.FILL, true, false);
      labelData.horizontalIndent = 10;
      descriptionLabel.setLayoutData(labelData);

      /*
 
View Full Code Here

    GridLayout layout = new GridLayout();   
    layout.numColumns = 2;
    shell.setLayout(layout);
    GridData data;
   
    label = new Label(shell,SWT.WRAP);
   
    combo = new Combo(shell,SWT.READ_ONLY);
   
    Button ok = new Button(shell,SWT.PUSH);
    ok.addListener(SWT.Selection, new Listener() {
View Full Code Here

    autoClearButton.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER,
        false, false));

    autoClearButton.setSelection(COConfigurationManager.getBooleanParameter("auto_remove_inactive_items"));

    Label dummy = new Label(toolbarPanel, SWT.NONE);
    dummy.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));

    final Button clearInActiveButton = new Button(toolbarPanel, SWT.NONE);
    clearInActiveButton.setText(MessageText.getString("Progress.reporting.window.remove.now"));
    clearInActiveButton.setToolTipText(MessageText.getString("Progress.reporting.window.remove.now.tooltip"));
    clearInActiveButton.setLayoutData(new GridData(SWT.END, SWT.CENTER, false,
View Full Code Here

    Composite emptyPanel = new Composite(scrollChild, SWT.BORDER);
    GridData gData = new GridData(SWT.FILL, SWT.FILL, true, true);
    gData.heightHint = 100;
    emptyPanel.setLayoutData(gData);
    emptyPanel.setLayout(new GridLayout());
    Label nothingToDisplay = new Label(emptyPanel, SWT.NONE);
    nothingToDisplay.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    nothingToDisplay.setText(MessageText.getString("Progress.reporting.no.reports.to.display"));

    /*
     * Mark this as being opened and is showing the empty panel
     */
    isShowingEmpty = true;
View Full Code Here

TOP

Related Classes of org.eclipse.swt.widgets.Label

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.