Examples of FormData


Examples of org.eclipse.swt.layout.FormData

    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

Examples of org.eclipse.swt.layout.FormData

    close.setCursor(composite.getDisplay().getSystemCursor(SWT.CURSOR_HAND));
    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);
   
View Full Code Here

Examples of org.eclipse.swt.layout.FormData

    Composite footer = new Composite(shell, SWT.NONE);
   
    FormLayout layout = new FormLayout();
    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);
   
View Full Code Here

Examples of org.eclipse.swt.layout.FormData

    layout.marginHeight = 5;
    layout.marginWidth = 50;
    layout.spacing = 5;
   
    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

Examples of org.eclipse.swt.layout.FormData

    layout.marginHeight = 5;
    layout.marginWidth = 5;
    layout.spacing = 5;
   
    footer.setLayout(layout);
    FormData data;
     
    data = new FormData();
    data.left = new FormAttachment(0,45);
    data.right = new FormAttachment(turnOnButton);
    dont_ask_again.setLayoutData(data);

    data = new FormData();
    data.right = new FormAttachment(100);
    data.width = 100;
    cancelButton.setLayoutData(data);
   
    data = new FormData();
    data.right = new FormAttachment( cancelButton );
    data.width = 100;
    turnOnButton.setLayoutData(data);
   
   
View Full Code Here

Examples of org.eclipse.swt.layout.FormData

          boolean changed = visible != control.isVisible()
              || (visible ? 1 : 0) != isVisible;

          Object ld = control.getLayoutData();
          if (ld instanceof FormData) {
            FormData fd = (FormData) ld;
            if (!visible) {
              if (fd.width > 0 && fd.height > 0) {
                control.setData("oldSize", new Point(fd.width, fd.height));
                changed = true;
              }
              fd.width = 0;
              fd.height = 0;
            } else {
              Object oldSize = control.getData("oldSize");
              Point oldSizePoint = (oldSize instanceof Point) ? (Point) oldSize
                  : new Point(SWT.DEFAULT, SWT.DEFAULT);
              if (fd.width <= 0) {
                changed = true;
                fd.width = oldSizePoint.x;
              }
              if (fd.height <= 0) {
                changed = true;
                fd.height = oldSizePoint.y;
              }
            }
            if (changed) {
              control.setLayoutData(fd);
              control.getParent().layout(true);
              Utils.relayout(control);
            }
          } else if (ld == null && !visible) {
            FormData fd = new FormData();
            fd.width = 0;
            fd.height = 0;
            control.setLayoutData(fd);
          }
          if (changed || true) { // For some reason this is required even when !changed (on Windows)
View Full Code Here

Examples of org.eclipse.swt.layout.FormData

    Object data = controlToLayout.getLayoutData();
    if (data != null && !(data instanceof FormData)) {
      return;
    }
    FormData oldFormData = (FormData) controlToLayout.getLayoutData();
    if (oldFormData == null) {
      oldFormData = new FormData();
    }

    FormData newFormData = new FormData(oldFormData.width, oldFormData.height);

    String templateID = properties.getStringValue(sConfigID
        + ".attach.template");
    if (templateID == null) {
      //templateID = skinObject.getSkinObjectID();
View Full Code Here

Examples of org.eclipse.swt.layout.FormData

            return;
          }

          Rectangle parentArea = sash.getParent().getClientArea();

          FormData formData = (FormData) sash.getLayoutData();
          formData.left = new FormAttachment(e.x * 100 / parentArea.width);
          sash.getParent().layout();
        }
      });
    } else {
View Full Code Here

Examples of org.eclipse.swt.layout.FormData

          if (FASTDRAG && e.detail == SWT.DRAG) {
            return;
          }

          Rectangle area = parentComposite.getBounds();
          FormData aboveData = (FormData) above.getLayoutData();
          FormData belowData = (FormData) below.getLayoutData();
          if (isVertical) {
            // Need to figure out if we have to use border width elsewhere
            // in calculations (probably)
            aboveData.width = e.x - above.getBorderWidth();
            if (aboveData.width < aboveMin) {
View Full Code Here

Examples of org.eclipse.swt.layout.FormData

      }
    } else {
      newAboveSize = 0;
    }

    FormData aboveData = (FormData) above.getLayoutData();
    if (aboveData == null) {
      aboveData = Utils.getFilledFormData();
      above.setLayoutData(aboveData);
    }
    if (isVertical) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.