Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.Text


      noDefaultAndApplyButton();
    } else {
      Label label = new Label(composite, SWT.None);
      label.setText("Description:");
      label.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false));
      _txtDescription = new Text(composite, SWT.MULTI|SWT.BORDER);
      _txtDescription.setData("description");
      GridData descriptionLayout = new GridData(SWT.FILL, SWT.FILL, true, false);
      descriptionLayout.heightHint = WidgetFactory.computeFontHeight(_txtDescription) * 5;
        _txtDescription.setLayoutData(descriptionLayout);
     
View Full Code Here


    Messages.setLanguageText(label, "exportTorrentWizard.exportfile.message");
 
    label = new Label(panel,SWT.NULL);
    Messages.setLanguageText(label, "exportTorrentWizard.exportfile.path");
 
    final Text textPath = new Text(panel,SWT.BORDER);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    textPath.setLayoutData(gridData);
    textPath.setText(((ExportTorrentWizard)wizard).getExportFile());
 
    Button browse = new Button(panel,SWT.PUSH);
    Messages.setLanguageText(browse, "exportTorrentWizard.exportfile.browse");
    browse.addListener(SWT.Selection,new Listener() {
     
      public void handleEvent(Event arg0){
       
      FileDialog fd = new FileDialog(wizard.getWizardWindow(), SWT.SAVE );
     
      fd.setFileName(textPath.getText());
     
      fd.setFilterExtensions(new String[]{"*.xml", Constants.FILE_WILDCARD});
     
      String path = fd.open();
     
      if(path != null) {
       
        textPath.setText(path);
      }    
      }
    });
 
    textPath.addListener(SWT.Modify, new Listener(){
     
      public void handleEvent(Event event) {
      String path = textPath.getText();
     
      pathSet( path );
      }
    });
 
    textPath.setText(((ExportTorrentWizard)wizard).getExportFile());
   
    textPath.setFocus();
  }
View Full Code Here

    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() {
      public void modifyText(ModifyEvent e) {
        refreshPWLabel();
      }
    });
    t2.addModifyListener(new ModifyListener() {
      public void modifyText(ModifyEvent e) {
        refreshPWLabel();
      }
    });
View Full Code Here

    Messages.setLanguageText(label, "exportTorrentWizard.torrentfile.message");
 
    label = new Label(panel,SWT.NULL);
    Messages.setLanguageText(label, "exportTorrentWizard.torrentfile.path");
 
    final Text textPath = new Text(panel,SWT.BORDER);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    textPath.setLayoutData(gridData);
    textPath.setText("");
 
    Button browse = new Button(panel,SWT.PUSH);
    Messages.setLanguageText(browse, "exportTorrentWizard.torrentfile.browse");
    browse.addListener(SWT.Selection,new Listener() {
      public void handleEvent(Event arg0) {
       
      FileDialog fd = new FileDialog(wizard.getWizardWindow());
     
      fd.setFileName(textPath.getText());
     
      fd.setFilterExtensions(new String[]{"*.torrent", "*.tor", Constants.FILE_WILDCARD});
     
      String path = fd.open();
     
      if(path != null) {
       
        textPath.setText(path);     
      }    
      }
    });
 
    textPath.addListener(SWT.Modify, new Listener(){
     
      public void handleEvent(Event event) {
       
      String path = textPath.getText();
     
      ((ExportTorrentWizard)wizard).setTorrentFile( path );

      file_valid = false;   
     
      try{
       
        File f = new File(path);
       
        if( f.exists()){
         
          if (f.isFile()){
           
            file_valid = true;
           
          wizard.setErrorMessage("");
          }else{
           
          wizard.setErrorMessage(MessageText.getString("exportTorrentWizard.torrentfile.invalidPath"));
          }           
        }
       
      }catch(Exception e){
        wizard.setErrorMessage(MessageText.getString("exportTorrentWizard.torrentfile.invalidPath"));
      }
     
      wizard.setNextEnabled( file_valid );
      }
    });

    textPath.setText(((ExportTorrentWizard)wizard).getTorrentFile());
   
    textPath.setFocus();
  }
View Full Code Here

    GridData gridData = new GridDataGridData.FILL_HORIZONTAL );
    gridData.widthHint = 200;
    gridData.horizontalSpan = 2;
    label.setLayoutData(gridData);

    txtInfo = new Text(shell, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL);
    gridData = new GridDataGridData.FILL_BOTH );
    gridData.widthHint = 500;
    gridData.heightHint = 400;
    gridData.horizontalSpan = 2;
    txtInfo.setLayoutData(gridData);
View Full Code Here

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

    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);
    file.addModifyListener(new ModifyListener() {
      /*
       * (non-Javadoc)
       *
       * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
View Full Code Here

    Messages.setLanguageText(label, "TrackerChangerWindow.newtracker");   
    GridData gridData = new GridData();
    gridData.widthHint = 200;
    label.setLayoutData(gridData);

    final Text url = new Text(shell, SWT.BORDER);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    gridData.widthHint = 300;
    url.setLayoutData(gridData);
    Utils.setTextLinkFromClipboard(shell, url, false);

    Composite panel = new Composite(shell, SWT.NULL);
    layout = new GridLayout();
    layout.numColumns = 3;
    panel.setLayout(layout);       
    gridData = new GridData();
    gridData.horizontalSpan = 2;
    panel.setLayoutData(gridData);
    Button ok = new Button(panel, SWT.PUSH);
    ok.setText(MessageText.getString("Button.ok"));
    gridData = new GridData();
    gridData.widthHint = 70;
    ok.setLayoutData(gridData);
    shell.setDefaultButton(ok);
    ok.addListener(SWT.Selection, new Listener() {
      /* (non-Javadoc)
       * @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
       */
      public void handleEvent(Event event) {
        try {
          for ( DownloadManager dm: dms ){
            TOTorrent  torrent = dm.getTorrent();
           
            if ( torrent != null ){
           
              TorrentUtils.announceGroupsInsertFirst( torrent, url.getText());
           
              TorrentUtils.writeToFile( torrent );
           
              TRTrackerAnnouncer announcer = dm.getTrackerClient();
             
View Full Code Here

  final String   name,
  final int    encoding )
  {
    super(name);
    this.name = name;
    inputField = new Text(composite, SWT.BORDER);
    inputField.setEchoChar('*');
    byte[] value = COConfigurationManager.getByteParameter(name, "".getBytes());
    if(value.length > 0)
      inputField.setText("***");
    inputField.addListener(SWT.Modify, new Listener() {
View Full Code Here

            layout.horizontalSpacing = 0;
            layout.verticalSpacing = 0;
            tabItemContainer.setLayout(layout);                      
            tabItem.setText (titel);
           
            Text headerTabText = new Text(tabItemContainer, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL);
            headerTabText.setData(current);
            headerTabText.setText(_headerFileMap.get(current).getDefaultHeader());      
           
            headerTabText.addModifyListener(new ModifyListener() {               
                public void modifyText(ModifyEvent e) {
                    if(e.getSource() instanceof Text){
                        Text source = (Text)e.getSource();
                        _headerFileMap.get((String)source.getData()).setDefaultHeader(source.getText());
                    }                 
                }
            });
           
            GridData codeLayout = new GridData(GridData.FILL_BOTH);
View Full Code Here

TOP

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

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.