Package org.eclipse.swt.layout

Examples of org.eclipse.swt.layout.FormData


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


        /* Ignore for Pre 3.0 SWT.. */
      }
      layout.marginHeight = 5;
      layout.marginWidth = 5;
      window.setLayout(layout);
      FormData formData;
     
        // text area
     
      text_area = new StyledText(window,SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
        
      text_area.setEditable(false);
     
      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(
View Full Code Here

  protected Point betterComputeSize(Composite c, Point size, int wHint,
      int hHint) {
    if (c.getChildren().length == 0 && (size.x == 64 || size.y == 64)) {
      Object ld = c.getLayoutData();
      if (ld instanceof FormData) {
        FormData fd = (FormData) ld;
        if (fd.width != 0 && fd.height != 0) {
          Rectangle trim = c.computeTrim (0, 0, fd.width, fd.height);
          return new Point(trim.width, trim.height);
        }
      }
View Full Code Here

  protected Point betterComputeSize(Composite c, Point size, int wHint, int hHint, boolean changed) {
    if (c.getChildren().length == 0 && (size.x == 64 || size.y == 64)) {
      Object ld = c.getLayoutData();
      if (ld instanceof FormData) {
        FormData fd = (FormData) ld;
        if (fd.width != 0 && fd.height != 0) {
          Rectangle trim = c.computeTrim (0, 0, fd.width, fd.height);
          return new Point(trim.width, trim.height);
        }
      }
View Full Code Here

      /* Ignore for Pre 3.0 SWT.. */
    }
    layout.marginHeight = 5;
    layout.marginWidth = 5;
    window.setLayout(layout);
    FormData formData;
   
      // text blocked area
   
    final StyledText textBlocked = new StyledText(window,SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
    Button btnClear = new Button(window,SWT.PUSH);
    textBlocked.setEditable(false);
   
    final StyledText textBanned = new StyledText(window,SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
    Button btnOk = new Button(window,SWT.PUSH);
    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() {
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);
View Full Code Here

    int fixedWidth = -1;
    int fixedHeight = -1;
    Object layoutData = control.getLayoutData();
    if (layoutData instanceof FormData) {
      FormData fd = (FormData) layoutData;
      fixedHeight = fd.height;
      fixedWidth = fd.width;
      if (fd.width != SWT.DEFAULT && fd.height != SWT.DEFAULT) {
        parent.layout();
        return;
View Full Code Here

        }
        shell.dispose();
      }
    });
   
    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);
   
View Full Code Here

     
        //Layout :
       
        //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);
       
View Full Code Here

    Label separator = new Label(shell,SWT.SEPARATOR | SWT.HORIZONTAL);
    Button cancel = new Button(shell,SWT.PUSH);
    action = new Button(shell,SWT.PUSH);
    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);
     
View Full Code Here

TOP

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

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.