Package org.eclipse.swt.layout

Examples of org.eclipse.swt.layout.GridLayout


  }


  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
View Full Code Here


 

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

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

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

   */
  public void show() {
    wizard.setTitle(MessageText.getString("wizard.multitracker.title"));
    wizard.setCurrentInfo("");
    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.VERTICAL_ALIGN_CENTER | GridData.FILL_HORIZONTAL);
    panel.setLayoutData(gridData);
    layout = new GridLayout();
    layout.numColumns = 3;
    panel.setLayout(layout);

    //Line :
    // Multi-Tracker Configuration
View Full Code Here

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

View Full Code Here

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

    /*
 
View Full Code Here

    Composite sectionContent = detailSection.getContent();

    detailSectionData = new GridData(SWT.FILL, SWT.FILL, true, true);
    detailSection.setLayoutData(detailSectionData);

    GridLayout sectionLayout = new GridLayout();
    sectionLayout.marginHeight = 0;
    sectionLayout.marginWidth = 0;
    sectionContent.setLayout(sectionLayout);
    detailSection.setEnabled(false);
View Full Code Here

      Debug.printStackTrace( e );
    }
    wizard.setTitle(MessageText.getString("wizard.torrentFile"));
    wizard.setCurrentInfo(MessageText.getString("wizard.choosetorrent"));
    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");*/
    final Text 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).savePath = 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).setDefaultSaveDir( parent );
            }
          }
        }
        wizard.setErrorMessage(error);
        wizard.setFinishEnabled(!((NewTorrentWizard)wizard).savePath.equals("") && error.equals(""));
      }
    });
   
      // if we have a default save dir then use this as the basis for save location
   
    String  target_file;
   
    if(((NewTorrentWizard)wizard).create_from_dir) {
      target_file = ((NewTorrentWizard)wizard).directoryPath + ".torrent";
    } else {     
      target_file = ((NewTorrentWizard)wizard).singlePath + ".torrent";
    }
   
    String  default_save = ((NewTorrentWizard)wizard).getDefaultSaveDir();
   
    if (default_save.length() > 0 ){
   
      File temp = new File( target_file );
     
      String  existing_parent = temp.getParent();
     
      if ( existing_parent != null ){
       
        target_file  = new File( default_save, temp.getName()).toString();
      }
    }
   
    ((NewTorrentWizard)wizard).savePath = target_file;
   
    file.setText(((NewTorrentWizard)wizard).savePath);
    GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
    gridData.horizontalSpan = 2;
    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(),SWT.SAVE);
        final String path = ((NewTorrentWizard)wizard).savePath;
        if(wizard.getErrorMessage().equals("") && !path.equals("")) {
            File fsPath = new File(path);
            if(!path.endsWith(File.separator)) {
                fd.setFilterPath(fsPath.getParent());
                fd.setFileName(fsPath.getName());
            }
            else {
                fd.setFileName(path);
            }
        }
        String f = fd.open();
        if (f != null){
            file.setText(f);
           
            File  ff = new File(f);

            String  parent = ff.getParent();

            if ( parent != null )
                ((NewTorrentWizard) wizard).setDefaultSaveDir( parent );
          }
      }
    });  
    Messages.setLanguageText(browse,"wizard.browse");
      // ----------------------
   
    label = new Label(panel, SWT.SEPARATOR | SWT.HORIZONTAL);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    gridData.horizontalSpan = 3;
    label.setLayoutData(gridData);
 
    Composite gFileStuff = new Composite(panel, SWT.NULL);
    gridData = new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL);
    gridData.horizontalSpan = 3;
    gFileStuff.setLayoutData(gridData);
    layout = new GridLayout();
    layout.numColumns = 4;
    gFileStuff.setLayout(layout);
   
      // file size
   
View Full Code Here

      ImageLoader imageLoader = ImageLoader.getInstance();
      imgOpenFolder = imageLoader.getImage("openFolderButton");     
    }

    GridData gridData;
    GridLayout layout;

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

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

    Composite cArea = new Composite(cSection, SWT.NONE);
    layout = new GridLayout();
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    layout.numColumns = 4;
    cArea.setLayout(layout);
    cArea.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    BooleanParameter d_play_sound = new BooleanParameter(cArea,
        "Play Download Finished", LBLKEY_PREFIX + "playdownloadfinished");

    // OS X counterpart for alerts (see below for what is disabled)
    if (Constants.isOSX) {
      // download info

      gridData = new GridData();
      gridData.horizontalSpan = 3;
      gridData.widthHint = 0;
      gridData.heightHint = 0;
      Composite d_filler = new Composite(cArea, SWT.NONE);
      d_filler.setSize(0, 0);
      d_filler.setLayoutData(gridData);

      final BooleanParameter d_speechEnabledParameter = new BooleanParameter(
          cArea, "Play Download Finished Announcement", LBLKEY_PREFIX
              + "playdownloadspeech");

      final StringParameter d_speechParameter = new StringParameter(cArea,
          "Play Download Finished Announcement Text");
      gridData = new GridData();
      gridData.horizontalSpan = 3;
      gridData.widthHint = 150;
      d_speechParameter.setLayoutData(gridData);
      ((Text) d_speechParameter.getControl()).setTextLimit(40);

      d_speechEnabledParameter.setAdditionalActionPerformer(new ChangeSelectionActionPerformer(
          d_speechParameter.getControls()));

      final Label d_speechInfo = new Label(cArea, SWT.NONE);
      gridData = new GridData();
      gridData.horizontalSpan = 4;
      gridData.horizontalIndent = 24;
      d_speechInfo.setLayoutData(gridData);

      Messages.setLanguageText(d_speechInfo, LBLKEY_PREFIX
          + "playdownloadspeech.info");
    }

    //Option disabled on OS X, as impossible to make it work correctly
    if (!Constants.isOSX) {

      // download info

      gridData = new GridData(GridData.FILL_HORIZONTAL);

      final StringParameter d_pathParameter = new StringParameter(cArea,
          "Play Download Finished File", "");

      if (d_pathParameter.getValue().length() == 0) {

        d_pathParameter.setValue("<default>");
      }

      d_pathParameter.setLayoutData(gridData);

      Button d_browse = new Button(cArea, SWT.PUSH);

      d_browse.setImage(imgOpenFolder);

      imgOpenFolder.setBackground(d_browse.getBackground());

      d_browse.setToolTipText(MessageText.getString("ConfigView.button.browse"));

      d_browse.addListener(SWT.Selection, new Listener() {
        public void handleEvent(Event event) {
          FileDialog dialog = new FileDialog(parent.getShell(),
              SWT.APPLICATION_MODAL);
          dialog.setFilterExtensions(new String[] { "*.wav"
          });
          dialog.setFilterNames(new String[] { "*.wav"
          });

          dialog.setText(MessageText.getString(INTERFACE_PREFIX + "wavlocation"));

          final String path = dialog.open();

          if (path != null) {

            d_pathParameter.setValue(path);

            new AEThread("SoundTest") {
              public void runSupport() {
                try {
                  Applet.newAudioClip(new File(path).toURL()).play();

                  Thread.sleep(2500);

                } catch (Throwable e) {

                }
              }
            }.start();
          }
        }
      });

      Label d_sound_info = new Label(cArea, SWT.WRAP);
      Messages.setLanguageText(d_sound_info, INTERFACE_PREFIX
          + "wavlocation.info");
      gridData = new GridData(GridData.FILL_HORIZONTAL);
      gridData.widthHint = 100;
      d_sound_info.setLayoutData(gridData);

      d_play_sound.setAdditionalActionPerformer(new ChangeSelectionActionPerformer(
          d_pathParameter.getControls()));
      d_play_sound.setAdditionalActionPerformer(new ChangeSelectionActionPerformer(
          new Control[] {
            d_browse,
            d_sound_info
          }));

      //
    }

    BooleanParameter f_play_sound = new BooleanParameter(cArea,
        "Play File Finished", LBLKEY_PREFIX + "playfilefinished");

    // OS X counterpart for alerts (see below for what is disabled)

    if (Constants.isOSX) {

      // per-file info

      gridData = new GridData();
      gridData.horizontalSpan = 3;
      gridData.widthHint = 0;
      gridData.heightHint = 0;
      Composite f_filler = new Composite(cArea, SWT.NONE);
      f_filler.setSize(0, 0);
      f_filler.setLayoutData(gridData);

      final BooleanParameter f_speechEnabledParameter = new BooleanParameter(
          cArea, "Play File Finished Announcement", LBLKEY_PREFIX
              + "playfilespeech");

      final StringParameter f_speechParameter = new StringParameter(cArea,
          "Play File Finished Announcement Text");
      gridData = new GridData();
      gridData.horizontalSpan = 3;
      gridData.widthHint = 150;
      f_speechParameter.setLayoutData(gridData);
      ((Text) f_speechParameter.getControl()).setTextLimit(40);

      f_speechEnabledParameter.setAdditionalActionPerformer(new ChangeSelectionActionPerformer(
          f_speechParameter.getControls()));

      final Label speechInfo = new Label(cArea, SWT.NONE);
      gridData = new GridData();
      gridData.horizontalSpan = 4;
      gridData.horizontalIndent = 24;
      speechInfo.setLayoutData(gridData);

      Messages.setLanguageText(speechInfo, LBLKEY_PREFIX
          + "playfilespeech.info");
    }

    //Option disabled on OS X, as impossible to make it work correctly
    if (!Constants.isOSX) {

      // file info

      gridData = new GridData(GridData.FILL_HORIZONTAL);

      final StringParameter f_pathParameter = new StringParameter(cArea,
          "Play File Finished File", "");

      if (f_pathParameter.getValue().length() == 0) {

        f_pathParameter.setValue("<default>");
      }

      f_pathParameter.setLayoutData(gridData);

      Button f_browse = new Button(cArea, SWT.PUSH);

      f_browse.setImage(imgOpenFolder);

      imgOpenFolder.setBackground(f_browse.getBackground());

      f_browse.setToolTipText(MessageText.getString("ConfigView.button.browse"));

      f_browse.addListener(SWT.Selection, new Listener() {
        public void handleEvent(Event event) {
          FileDialog dialog = new FileDialog(parent.getShell(),
              SWT.APPLICATION_MODAL);
          dialog.setFilterExtensions(new String[] { "*.wav"
          });
          dialog.setFilterNames(new String[] { "*.wav"
          });

          dialog.setText(MessageText.getString(INTERFACE_PREFIX + "wavlocation"));

          final String path = dialog.open();

          if (path != null) {

            f_pathParameter.setValue(path);

            new AEThread("SoundTest") {
              public void runSupport() {
                try {
                  Applet.newAudioClip(new File(path).toURL()).play();

                  Thread.sleep(2500);

                } catch (Throwable e) {

                }
              }
            }.start();
          }
        }
      });

      Label f_sound_info = new Label(cArea, SWT.WRAP);
      Messages.setLanguageText(f_sound_info, INTERFACE_PREFIX
          + "wavlocation.info");
      gridData = new GridData(GridData.FILL_HORIZONTAL);
      gridData.widthHint = 100;
      f_sound_info.setLayoutData(gridData);

      f_play_sound.setAdditionalActionPerformer(new ChangeSelectionActionPerformer(
          f_pathParameter.getControls()));
      f_play_sound.setAdditionalActionPerformer(new ChangeSelectionActionPerformer(
          new Control[] {
            f_browse,
            f_sound_info
          }));
    }

    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(GridData.FILL_HORIZONTAL));
View Full Code Here

   */
  public void show() {
    wizard.setTitle(MessageText.getString("wizard.webseed.title"));
    wizard.setCurrentInfo("");
    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.VERTICAL_ALIGN_CENTER | GridData.FILL_HORIZONTAL);
    panel.setLayoutData(gridData);
    layout = new GridLayout();
    layout.numColumns = 3;
    panel.setLayout(layout);

    //Line :
    // Web Seed Configuration
View Full Code Here

    show()
    {
    wizard.setTitle(MessageText.getString("exportTorrentWizard.torrentfile.title"));
   
    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.VERTICAL_ALIGN_CENTER | GridData.FILL_HORIZONTAL);
    panel.setLayoutData(gridData);
    layout = new GridLayout();
    layout.numColumns = 3;
    panel.setLayout(layout);
 
    Label label = new Label(panel, SWT.WRAP);
    gridData = new GridData();
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.