Package org.eclipse.swt.layout

Examples of org.eclipse.swt.layout.FormAttachment


            instance.cancel();
          }
        });
     
    FormData  data = new FormData();
    data.right   = new FormAttachment(100,0);
    data.top  = new FormAttachment(0,0);
    data.bottom  = new FormAttachment(100,0);

    cancel_button.setLayoutData( data );
     
    final Label label = new Label(parent, SWT.NULL );
   
    label.setText( "blah blah " );
   
    data = new FormData();
    data.left   = new FormAttachment(0,0);
    data.top  = new FormAttachment(cancel_button,0, SWT.CENTER);

    label.setLayoutData( data );

    final ProgressBar progress = new ProgressBar(parent, SWT.NULL );
   
    progress.setMinimum( 0 );
    progress.setMaximum( 100 );
    progress.setSelection( 0 );
   
   
    data = new FormData();
    data.left   = new FormAttachment(label,4);
    data.top  = new FormAttachment(cancel_button, 0, SWT.CENTER);
    data.right  = new FormAttachment(cancel_button,-4);

    progress.setLayoutData( data );
   
    parent.layout( true, true );
   
View Full Code Here


      Button btnOk = new Button(window,SWT.PUSH);
      Button btnAbort = new Button(window,SWT.PUSH);
     
             
      formData = new FormData();
      formData.left = new FormAttachment(0,0);
      formData.right = new FormAttachment(100,0);
      formData.top = new FormAttachment(0,0);  
      formData.bottom = new FormAttachment(90,0);  
      text_area.setLayoutData(formData);
     
     
        // label
     
      Label  info_label = new Label(window, SWT.NULL);
      Messages.setLanguageText(info_label,"updater.progress.window.info");
      formData = new FormData();
      formData.top = new FormAttachment(text_area);   
      formData.right = new FormAttachment(btnAbort);   
      formData.left = new FormAttachment(0,0);   
      info_label.setLayoutData( formData );   
    
     
        // abort button
     
      Messages.setLanguageText(btnAbort,"Button.abort");
      formData = new FormData();
      formData.right = new FormAttachment(btnOk);   
      formData.bottom = new FormAttachment(100,0);   
      formData.width = 70;
      btnAbort.setLayoutData(formData);
      btnAbort.addListener(
          SWT.Selection,
        new Listener()
        {
            public void
          handleEvent(
            Event e)
            {
              manager.removeListener( UpdateProgressWindow.this  );
             
              for (int i=0;i<current_instances.size();i++){
               
                ((UpdateCheckInstance)current_instances.get(i)).cancel();
              }
             
              window.dispose();
             }
        });
     
        // ok button
     
      Messages.setLanguageText(btnOk,"Button.ok");
      formData = new FormData();
      formData.right = new FormAttachment(95,0);   
      formData.bottom = new FormAttachment(100,0);   
      formData.width = 70;
      btnOk.setLayoutData(formData);
      btnOk.addListener(
          SWT.Selection,
        new Listener()
View Full Code Here

    Button btnReset = new Button(window,SWT.PUSH);
    textBanned.setEditable(false);
   
           
    formData = new FormData();
    formData.left = new FormAttachment(0,0);
    formData.right = new FormAttachment(100,0);
    formData.top = new FormAttachment(0,0);  
    formData.bottom = new FormAttachment(40,0);  
    textBlocked.setLayoutData(formData);
    textBlocked.setText(ipsBlocked);
   
   
    // label blocked area
   
    Label  blockedInfo = new Label(window, SWT.NULL);
    Messages.setLanguageText(blockedInfo,"ConfigView.section.ipfilter.blockedinfo");
    formData = new FormData();
    formData.top = new FormAttachment(textBlocked);   
    formData.right = new FormAttachment(btnClear);   
    formData.left = new FormAttachment(0,0);   
    blockedInfo.setLayoutData( formData );
      // clear button
   
   
    Messages.setLanguageText(btnClear,"Button.clear");
    formData = new FormData();
    formData.top = new FormAttachment(textBlocked);   
    formData.right = new FormAttachment(95,0 );   
    //formData.bottom = new FormAttachment(textBanned);
    formData.width = 70;
    btnClear.setLayoutData(formData);
    btnClear.addListener(SWT.Selection,new Listener() {

    public void handleEvent(Event e) {
    
      azureus_core.getIpFilterManager().getIPFilter().clearBlockedIPs();
     
      textBlocked.setText( "" );
    }
    });
   
   
      // text banned area
    formData = new FormData();
    formData.left = new FormAttachment(0,0);
    formData.right = new FormAttachment(100,0);
    formData.top = new FormAttachment(btnClear);  
    formData.bottom = new FormAttachment(btnOk);  
    textBanned.setLayoutData(formData);
    textBanned.setText(ipsBanned);
   
      // label banned area
   
    Label  bannedInfo = new Label(window, SWT.NULL);
    Messages.setLanguageText(bannedInfo,"ConfigView.section.ipfilter.bannedinfo");
    formData = new FormData();
    formData.right = new FormAttachment(btnReset);   
    formData.left = new FormAttachment(0,0);   
    formData.bottom = new FormAttachment(100,0)
    bannedInfo.setLayoutData( formData );
   
      // reset button
   
    Messages.setLanguageText(btnReset,"Button.reset");
    formData = new FormData();
    formData.right = new FormAttachment(btnOk);   
    formData.bottom = new FormAttachment(100,0);   
    formData.width = 70;
    btnReset.setLayoutData(formData);
    btnReset.addListener(SWT.Selection,new Listener() {

    public void handleEvent(Event e) {
      azureus_core.getIpFilterManager().getIPFilter().clearBannedIps();
      azureus_core.getIpFilterManager().getBadIps().clearBadIps();
   
      textBanned.setText( "" );   
      }
    });
      // ok button
   
    Messages.setLanguageText(btnOk,"Button.ok");
    formData = new FormData();
    formData.right = new FormAttachment(95,0);   
    formData.bottom = new FormAttachment(100,0);   
    formData.width = 70;
    btnOk.setLayoutData(formData);
    btnOk.addListener(SWT.Selection,new Listener() {

    public void handleEvent(Event e) {
View Full Code Here

    return gridData;
  }

  public static FormData getFilledFormData() {
    FormData formData = new FormData();
    formData.top = new FormAttachment(0, 0);
    formData.left = new FormAttachment(0, 0);
    formData.right = new FormAttachment(100, 0);
    formData.bottom = new FormAttachment(100, 0);

    return formData;
  }
View Full Code Here

    });
   
    FormData data;
   
    data =  new FormData();
    data.left = new FormAttachment(0,5);
    data.right = new FormAttachment(100,-5);
    data.top = new FormAttachment(0,5);
    explain.setLayoutData(data);
   
    data =  new FormData();
    data.left = new FormAttachment(0,5);
    data.right = new FormAttachment(100,-5);
    data.top = new FormAttachment(explain,5);
    data.bottom = new FormAttachment(separator,-5);
    browser.setLayoutData(data);
   
    data =  new FormData();
    data.left = new FormAttachment(0,0);
    data.right = new FormAttachment(100,0);
    data.bottom = new FormAttachment(cancel,-5);
    separator.setLayoutData(data);
   
    if ( isMine ){
     
      data =  new FormData();
      data.width = 100;
      data.left = new FormAttachment(0,5);
      data.right = new FormAttachment(cancel,-5);
      data.bottom = new FormAttachment(100,-5);
      alt_method.setLayoutData(data);
    }
   
    data =  new FormData();
    data.width = 100;
    data.right = new FormAttachment(done,-5);
    data.bottom = new FormAttachment(100,-5);
    cancel.setLayoutData(data);
   
    data =  new FormData();
    data.width = 100;
    data.right = new FormAttachment(100,-5);
    data.bottom = new FormAttachment(100,-5);
    done.setLayoutData(data);
   
    shell.layout();
    shell.open();
  }
View Full Code Here

       
        //Progress Bar on bottom, with Hide button next to it.
     
        FormData formData;
        formData = new FormData();
        formData.right = new FormAttachment(100,-5);
        formData.bottom = new FormAttachment(100,-10);
       
        hide_button.setLayoutData(formData);
      
        formData = new FormData();
        formData.right = new FormAttachment(hide_button,-5);
        formData.bottom = new FormAttachment(100,-10);
       
        cancel_button.setLayoutData(formData);
             
        formData = new FormData();
        formData.right = new FormAttachment(cancel_button,-5);
        formData.left = new FormAttachment(0,50);
        formData.bottom = new FormAttachment(100,-10);
       
        progress.setLayoutData(formData);
       
        formData = new FormData();
        formData.right = new FormAttachment(100,-5);
        formData.bottom = new FormAttachment(100,-50);
        formData.top = new FormAttachment(0,5);
        formData.left = new FormAttachment(0,5);
       
        tasks.setLayoutData(formData);
       
       
        layout();
View Full Code Here

    cancel.setText(MessageText.getString("Button.cancel"));
   
    FormData data;
   
    data = new FormData();
    data.left = new FormAttachment(0,0);
    data.right = new FormAttachment(100,0);
    data.top = new FormAttachment(0,0);
    data.bottom = new FormAttachment(separator,0);
    mainComposite.setLayoutData(data);
   
    data = new FormData();
    data.left = new FormAttachment(0,0);
    data.right = new FormAttachment(100,0);
    data.bottom = new FormAttachment(cancel,-2);
    separator.setLayoutData(data);
   
    data = new FormData();
    data.right = new FormAttachment(action);
    data.width = 100;
    data.bottom = new FormAttachment(100,-5);
    cancel.setLayoutData(data);
   
    data = new FormData();
    data.right = new FormAttachment(100,-5);
    data.width = 100;
    data.bottom = new FormAttachment(100,-5);
    action.setLayoutData(data);
   
    cancel.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event arg0) {
        if(lookup != null) {
          lookup.cancel();
        }
        if(!shell.isDisposed()) {
          shell.dispose();
        }
      }
    });
   
    mainLayout = new StackLayout();
    mainComposite.setLayout(mainLayout);
   
    loadingPanel = new Composite(mainComposite,SWT.NONE);
    loadingPanel.setLayout(new FormLayout());
   
    listPanel = new Composite(mainComposite,SWT.NONE);
    listPanel.setLayout(new FillLayout());
   
    subscriptionsList = new Table(listPanel,SWT.V_SCROLL | SWT.SINGLE | SWT.FULL_SELECTION | SWT.VIRTUAL);
    subscriptionsList.setHeaderVisible(true);
   
    TableColumn name = new TableColumn(subscriptionsList,SWT.NONE);
    name.setText(MessageText.getString("subscriptions.listwindow.name"));
    name.setWidth(310);
    name.setResizable(false);
   
    TableColumn popularity = new TableColumn(subscriptionsList,SWT.NONE);
    popularity.setText(MessageText.getString("subscriptions.listwindow.popularity"));
    popularity.setWidth(70);
    popularity.setResizable(false);
   
    subscriptionsList.addListener(SWT.SetData, new Listener() {
      public void handleEvent(Event e) {
        TableItem item = (TableItem) e.item;
        int index = subscriptionsList.indexOf(item);
        if(index >= 0 && index < subscriptionItems.length) {
          SubscriptionItemModel subscriptionItem = subscriptionItems[index];
          item.setText(0,subscriptionItem.name);
          item.setText(1,subscriptionItem.popularityDisplay);
        }
      }
    });
   
    subscriptionsList.setSortColumn(popularity);
    subscriptionsList.setSortDirection(SWT.DOWN);
   
    subscriptionsList.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event arg0) {
        action.setEnabled(subscriptionsList.getSelectionIndex() != -1);
      }
    });
   
    Listener sortListener = new Listener() {
      public void handleEvent(Event e) {
        // determine new sort column and direction
        TableColumn sortColumn = subscriptionsList.getSortColumn();
        TableColumn currentColumn = (TableColumn) e.widget;
        int dir = subscriptionsList.getSortDirection();
        if (sortColumn == currentColumn) {
          dir = dir == SWT.UP ? SWT.DOWN : SWT.UP;
        } else {
          subscriptionsList.setSortColumn(currentColumn);
          dir = SWT.DOWN;
        }
        subscriptionsList.setSortDirection(dir);
        sortAndRefresh();
      }
    };
    name.addListener(SWT.Selection, sortListener);
    popularity.addListener(SWT.Selection, sortListener);
   
    animatedImage = new AnimatedImage(loadingPanel);
    loadingText = new Label(loadingPanel,SWT.WRAP | SWT.CENTER);
    loadingProgress = new ProgressBar(loadingPanel,SWT.HORIZONTAL);
   
    animatedImage.setImageFromName("spinner_big");
    String contentName = "Dummy";
    if(download != null) {
      contentName = download.getDisplayName();
    }
    loadingText.setText(MessageText.getString("subscriptions.listwindow.loadingtext", new String[] {contentName}));
   
    loadingProgress.setMinimum(0);
    loadingProgress.setMaximum(300);
    loadingProgress.setSelection(0);
   
    data = new FormData();
    data.left = new FormAttachment(1,2,-16);
    data.top = new FormAttachment(1,2,-32);
    data.width = 32;
    data.height = 32;
    animatedImage.setLayoutData(data);
   
    data = new FormData();
    data.left = new FormAttachment(0,5);
    data.right = new FormAttachment(100,-5);
    data.top = new FormAttachment(animatedImage.getControl(),10);
    data.height = 50;
    loadingText.setLayoutData(data);
   
    data = new FormData();
    data.left = new FormAttachment(0,5);
    data.right = new FormAttachment(100,-5);
    data.top = new FormAttachment(loadingText,5);
    loadingProgress.setLayoutData(data);
   
    boolean autoCheck = COConfigurationManager.getBooleanParameter("subscriptions.autocheck");
   
    if(autoCheck) {
      startChecking();
    } else {
      action.setText(MessageText.getString("Button.yes"));
      Composite acceptPanel = new Composite(mainComposite,SWT.NONE);
      acceptPanel.setLayout(new FormLayout());
     
      Label acceptLabel = new Label(acceptPanel,SWT.WRAP | SWT.CENTER);
     
      acceptLabel.setText(MessageText.getString("subscriptions.listwindow.autochecktext"));
     
      data = new FormData();
      data.left = new FormAttachment(0,5);
      data.right = new FormAttachment(100,-5);
      data.top = new FormAttachment(1,3,0);
      acceptLabel.setLayoutData(data);
     
      action.addListener(SWT.Selection, new Listener() {
        public void handleEvent(Event event) {
          action.removeListener(SWT.Selection,this);
View Full Code Here

    close.addListener(SWT.MouseUp, new Listener() {
      public void handleEvent(Event arg0) {
        COConfigurationManager.setParameter("subscriptions.view.showhelp", false);
        composite.setVisible(false);
        FormData data = (FormData) view.getComposite().getLayoutData();
        data.bottom = new FormAttachment(100,0);
        viewComposite.layout(true);
      }
    });
   
    FormLayout layout = new FormLayout();
    composite.setLayout(layout);
   
    FormData data;
   
    data = new FormData();
    data.left = new FormAttachment(0,15);
    data.top = new FormAttachment(0,20);
    data.bottom = new FormAttachment(postText,-5);
    preText.setLayoutData(data);
   
    data = new FormData();
    data.left = new FormAttachment(preText,5);
    data.top = new FormAttachment(preText,0,SWT.CENTER);
    image.setLayoutData(data);
   
    data = new FormData();
    data.left = new FormAttachment(preText,0,SWT.LEFT);
    //data.top = new FormAttachment(preText,5);
    data.bottom = new FormAttachment(100,-20);
    postText.setLayoutData(data);
   
    data = new FormData();
    data.right = new FormAttachment(100,-10);
    data.top = new FormAttachment(0,10);   
    close.setLayoutData(data);
   
    data = new FormData();
    data.left = new FormAttachment(0,0);
    data.right = new FormAttachment(100,0);
    data.top = new FormAttachment(0,0);
    data.bottom = new FormAttachment(composite,0);   
    view.getComposite().setLayoutData(data);
   
    data = new FormData();
    data.left = new FormAttachment(0,0);
    data.right = new FormAttachment(100,0);
    data.bottom = new FormAttachment(100,0);   
    composite.setLayoutData(data);
   
    COConfigurationManager.setBooleanDefault("subscriptions.view.showhelp", true);
    if(!COConfigurationManager.getBooleanParameter("subscriptions.view.showhelp")) {
      composite.setVisible(false);
      data = (FormData) view.getComposite().getLayoutData();
      data.bottom = new FormAttachment(100,0);
      viewComposite.layout(true);
    }

  }
View Full Code Here

    shell.setLayout(layout);
   
    FormData data;
   
    data = new FormData();
    data.top = new FormAttachment(0,0);
    data.left = new FormAttachment(0,0);
    data.right = new FormAttachment(100,0);
    //data.height = 50;
    header.setLayoutData(data);
   
    data = new FormData();
    data.top = new FormAttachment(header,0);
    data.left = new FormAttachment(0,0);
    data.right = new FormAttachment(100,0);
    topSeparator.setLayoutData(data);
   
    data = new FormData();
    data.top = new FormAttachment(topSeparator,0);
    data.left = new FormAttachment(0,0);
    data.right = new FormAttachment(100,0);
    data.bottom = new FormAttachment(bottomSeparator,0);
    main.setLayoutData(data);
   
    data = new FormData();
    data.left = new FormAttachment(0,0);
    data.right = new FormAttachment(100,0);
    data.bottom = new FormAttachment(footer,0);
    bottomSeparator.setLayoutData(data);
   
    data = new FormData();
    data.bottom = new FormAttachment(100,0);
    data.left = new FormAttachment(0,0);
    data.right = new FormAttachment(100,0);
    footer.setLayoutData(data);
   
    populateHeader(header);
   
    populateMain( main, no_space_available );
View Full Code Here

   
    main.setLayout(layout);
    FormData data;
   
    data = new FormData();
    data.top = new FormAttachment(0, 20);
    data.left = new FormAttachment(0);
    image_area.setLayoutData(data);
   
    data = new FormData();
    data.top = new FormAttachment(image_area,10);
    data.left = new FormAttachment(0);
    data.right = new FormAttachment(100);
    text1.setLayoutData(data);
   
    data = new FormData();
    data.top = new FormAttachment(text1, 10 );
    data.left = new FormAttachment(0);
    data.right = new FormAttachment(100);
    text2.setLayoutData(data);
   
    data = new FormData();
    data.top = new FormAttachment(text2, 10 );
    data.left = new FormAttachment(0);
    data.right = new FormAttachment(100);
    noSpaceWarning.setLayoutData(data);
   
    data = new FormData();
    data.top = new FormAttachment(noSpaceWarning, 10 );
    data.left = new FormAttachment(0);
    link.setLayoutData(data);
  }
View Full Code Here

TOP

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

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.