Package org.eclipse.swt.layout

Examples of org.eclipse.swt.layout.FormAttachment


          .getImage(DLG_IMG_TITLE_BANNER));
    else
      titleImageLabel.setImage(titleAreaImage);

    FormData imageData = new FormData();
    imageData.top = new FormAttachment(0, 0);
    // Note: do not use horizontalSpacing on the right as that would be a
    // regression from
    // the R2.x style where there was no margin on the right and images are
    // flush to the right
    // hand side. see reopened comments in 41172
    imageData.right = new FormAttachment(100, 0); // horizontalSpacing
    titleImageLabel.setLayoutData(imageData);
    // Title label @ top, left
    titleLabel = new Label(parent, SWT.LEFT);
    JFaceColors.setColors(titleLabel, foreground, background);
    titleLabel.setFont(JFaceResources.getBannerFont());
    titleLabel.setText(" ");//$NON-NLS-1$
    FormData titleData = new FormData();
    titleData.top = new FormAttachment(0, verticalSpacing);
    titleData.right = new FormAttachment(titleImageLabel);
    titleData.left = new FormAttachment(0, horizontalSpacing);
    titleLabel.setLayoutData(titleData);
    // Message image @ bottom, left
    messageImageLabel = new Label(parent, SWT.CENTER);
    messageImageLabel.setBackground(background);
    // Message label @ bottom, center
View Full Code Here


   *            int The spacing between widgets on the horizontal axis.
   */
  private void setLayoutsForNormalMessage(int verticalSpacing,
      int horizontalSpacing) {
    FormData messageImageData = new FormData();
    messageImageData.top = new FormAttachment(titleLabel, verticalSpacing);
    messageImageData.left = new FormAttachment(0, H_GAP_IMAGE);
    messageImageLabel.setLayoutData(messageImageData);
    FormData messageLabelData = new FormData();
    messageLabelData.top = new FormAttachment(titleLabel, verticalSpacing);
    messageLabelData.right = new FormAttachment(titleImageLabel);
    messageLabelData.left = new FormAttachment(messageImageLabel,
        horizontalSpacing);
    messageLabelData.height = messageLabelHeight;
    if (titleImageLargest)
      messageLabelData.bottom = new FormAttachment(titleImageLabel, 0,
          SWT.BOTTOM);
    messageLabel.setLayoutData(messageLabelData);
    FormData fillerData = new FormData();
    fillerData.left = new FormAttachment(0, horizontalSpacing);
    fillerData.top = new FormAttachment(messageImageLabel, 0);
    fillerData.bottom = new FormAttachment(messageLabel, 0, SWT.BOTTOM);
    bottomFillerLabel.setLayoutData(fillerData);
    FormData data = new FormData();
    data.top = new FormAttachment(messageImageLabel, 0, SWT.TOP);
    data.left = new FormAttachment(0, 0);
    data.bottom = new FormAttachment(messageImageLabel, 0, SWT.BOTTOM);
    data.right = new FormAttachment(messageImageLabel, 0);
    leftFillerLabel.setLayoutData(data);
  }
View Full Code Here

       * background of the messages changes there will be gaps between the
       * icon label and the message that are the background color of the
       * shell. We add a leading space elsewhere to compendate for this.
       */
      FormData data = new FormData();
      data.left = new FormAttachment(0, H_GAP_IMAGE);
      data.top = new FormAttachment(titleLabel, verticalSpacing);
      messageImageLabel.setLayoutData(data);
      data = new FormData();
      data.top = new FormAttachment(messageImageLabel, 0);
      data.left = new FormAttachment(0, 0);
      data.bottom = new FormAttachment(messageLabel, 0, SWT.BOTTOM);
      data.right = new FormAttachment(messageImageLabel, 0, SWT.RIGHT);
      bottomFillerLabel.setLayoutData(data);
      data = new FormData();
      data.top = new FormAttachment(messageImageLabel, 0, SWT.TOP);
      data.left = new FormAttachment(0, 0);
      data.bottom = new FormAttachment(messageImageLabel, 0, SWT.BOTTOM);
      data.right = new FormAttachment(messageImageLabel, 0);
      leftFillerLabel.setLayoutData(data);
      FormData messageLabelData = new FormData();
      messageLabelData.top = new FormAttachment(titleLabel,
          verticalSpacing);
      messageLabelData.right = new FormAttachment(titleImageLabel);
      messageLabelData.left = new FormAttachment(messageImageLabel, 0);
      messageLabelData.height = messageLabelHeight;
      if (titleImageLargest)
        messageLabelData.bottom = new FormAttachment(titleImageLabel,
            0, SWT.BOTTOM);
      messageLabel.setLayoutData(messageLabelData);
    }

    if (forceLayout) {
View Full Code Here

   *
   * @param top
   */
  private void resetWorkAreaAttachments(Control top) {
    FormData childData = new FormData();
    childData.top = new FormAttachment(top);
    childData.right = new FormAttachment(100, 0);
    childData.left = new FormAttachment(0, 0);
    childData.bottom = new FormAttachment(100, 0);
    workArea.setLayoutData(childData);
  }
View Full Code Here

    layout.marginWidth = 0;
    layout.horizontalSpacing = 0;
    titleComposite.setLayout(layout);
   
    FormData titleFormData = new FormData();
       titleFormData.top = new FormAttachment(0,0);
      titleFormData.left = new FormAttachment(0,0);
      titleFormData.right = new FormAttachment(100,0);
      titleFormData.bottom = new FormAttachment(100,0);
   
    titleComposite.setLayoutData(titleFormData);
    createTitleArea(titleComposite);
   
    Label separator = new Label(pageAreaComposite, SWT.HORIZONTAL | SWT.SEPARATOR);
View Full Code Here

   *
   * @return FormData for the message area.
   */
  private FormData createMessageAreaData() {
    FormData messageData = new FormData();
    messageData.top = new FormAttachment(0);
    messageData.bottom = new FormAttachment(100);
    messageData.right = new FormAttachment(100);
    messageData.left = new FormAttachment(0);
    return messageData;
  }
View Full Code Here

    addControlListeners();
    form.setTabList(new Control[] { control });

    // Set up the initial layout data.
    FormData data = new FormData();
    data.left = new FormAttachment(0, 0);
    data.top = new FormAttachment(0, 0);
    data.right = new FormAttachment(100, 0);
    data.bottom = new FormAttachment(100, 0);
    control.setLayoutData(data);

  }
View Full Code Here

        opposing = LEFT_TOP;
      }
      if (decDatas[opposing] == null) {
        // No decorator on the opposing side.
        // Attach the control to this decorator
        formData.left = new FormAttachment(decData.label);
      } else if (decDatas[opposing].data.width < newWidth) {
        // Decorator on opposing side is the smaller one. Attach
        // control to the new one.
        formData.left = new FormAttachment(decData.label);
        // Center align the smaller one relative to the larger one.
        decDatas[opposing].data.left.alignment = SWT.CENTER;
        decDatas[opposing].data.left.control = decData.label;
      } else {
        // The new decorator is the smaller one. Keep the
        // control attached to the opposing one.
        formData = null;
        // Horizontally center the smaller one relative to the larger
        // one.
        decData.data.left.alignment = SWT.CENTER;
        decData.data.left.control = decDatas[opposing].label;
      }
      break;
    /*
     * The only real difference in right side cases is that we are attaching
     * the right side of the control to the wider decoration rather than the
     * left side of the control. Other concerns (horizontally aligning the
     * smaller decoration relative to the larger one) are the same.
     */
    case RIGHT_TOP:
    case RIGHT_BOTTOM:
      if (index == RIGHT_TOP) {
        opposing = RIGHT_BOTTOM;
      } else {
        opposing = RIGHT_TOP;
      }
      if (decDatas[opposing] == null) {
        // No decorator on the opposing side.
        // Attach the control to this decorator.
        formData.right = new FormAttachment(decData.label);
      } else if (decDatas[opposing].data.width < newWidth) {
        // Decorator on opposing side is the smaller one. Attach
        // control to the new one.
        formData.right = new FormAttachment(decData.label);
        // Center align the smaller one to the larger one.
        // Note that this could be done using the left or right
        // attachment, we use the right since it is already
        // created for all right-side decorations.
        decDatas[opposing].data.right.alignment = SWT.CENTER;
View Full Code Here

        "Index out of range"); //$NON-NLS-1$

    FormData data = new FormData();
    switch (index) {
    case LEFT_TOP:
      data.left = new FormAttachment(0, 0);
      data.top = new FormAttachment(0, 0);
      break;
    case LEFT_BOTTOM:
      data.left = new FormAttachment(0, 0);
      data.bottom = new FormAttachment(100, 0);
      break;
    case RIGHT_TOP:
      data.right = new FormAttachment(100, 0);
      data.top = new FormAttachment(0, 0);
      break;
    case RIGHT_BOTTOM:
      data.right = new FormAttachment(100, 0);
      data.bottom = new FormAttachment(100, 0);
      break;
    }
    data.width = widthOf(image);
    data.height = SWT.DEFAULT;
View Full Code Here

        // Jobname line
        wlName=new Label(shell, SWT.RIGHT);
        wlName.setText("Job entry name ");
        props.setLook(wlName);
        fdlName=new FormData();
        fdlName.left = new FormAttachment(0, 0);
        fdlName.right= new FormAttachment(middle, -margin);
        fdlName.top  = new FormAttachment(0, margin);
        wlName.setLayoutData(fdlName);
        wName=new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
        props.setLook(wName);
        wName.addModifyListener(lsMod);
        fdName=new FormData();
        fdName.left = new FormAttachment(middle, 0);
        fdName.top  = new FormAttachment(0, margin);
        fdName.right= new FormAttachment(100, 0);
        wName.setLayoutData(fdName);
       
        // AccessKey line
        wlAccessKey=new Label(shell, SWT.RIGHT);
        wlAccessKey.setText("Access Key");
        props.setLook(wlAccessKey);
        fdlAccessKey=new FormData();
        fdlAccessKey.left = new FormAttachment(0, 0);
        fdlAccessKey.top  = new FormAttachment(wName, margin);
        fdlAccessKey.right= new FormAttachment(middle, -margin);
        wlAccessKey.setLayoutData(fdlAccessKey);
        wAccessKey=new TextVar(jobMeta, shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
        props.setLook(wAccessKey);
        wAccessKey.addModifyListener(lsMod);
        fdAccessKey=new FormData();
        fdAccessKey.left = new FormAttachment(middle, 0);
        fdAccessKey.top  = new FormAttachment(wName, margin);
        fdAccessKey.right= new FormAttachment(100, 0);
        wAccessKey.setLayoutData(fdAccessKey);       

    // PrivateKey line
    wlPrivateKey=new Label(shell, SWT.RIGHT);
    wlPrivateKey.setText("Private Key");
     props.setLook(wlPrivateKey);
    fdlPrivateKey=new FormData();
    fdlPrivateKey.left = new FormAttachment(0, 0);
    fdlPrivateKey.top  = new FormAttachment(wAccessKey, margin);
    fdlPrivateKey.right= new FormAttachment(middle, -margin);
    wlPrivateKey.setLayoutData(fdlPrivateKey);
    wPrivateKey=new TextVar(jobMeta, shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
     props.setLook(wPrivateKey);
    wPrivateKey.addModifyListener(lsMod);
    fdPrivateKey=new FormData();
    fdPrivateKey.left = new FormAttachment(middle, 0);
    fdPrivateKey.top  = new FormAttachment(wAccessKey, margin);
    fdPrivateKey.right= new FormAttachment(100, 0);
    wPrivateKey.setLayoutData(fdPrivateKey);

    // S3Bucket line
    wlS3Bucket=new Label(shell, SWT.RIGHT);
    wlS3Bucket.setText("S3Bucket");
     props.setLook(wlS3Bucket);
    fdlS3Bucket=new FormData();
    fdlS3Bucket.left = new FormAttachment(0, 0);
    fdlS3Bucket.top  = new FormAttachment(wPrivateKey, margin);
    fdlS3Bucket.right= new FormAttachment(middle, -margin);
    wlS3Bucket.setLayoutData(fdlS3Bucket);
    wS3Bucket=new TextVar(jobMeta, shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
     props.setLook(wS3Bucket);
    wS3Bucket.addModifyListener(lsMod);
    fdS3Bucket=new FormData();
    fdS3Bucket.left = new FormAttachment(middle, 0);
    fdS3Bucket.top  = new FormAttachment(wPrivateKey, margin);
    fdS3Bucket.right= new FormAttachment(100, 0);
    wS3Bucket.setLayoutData(fdS3Bucket);

    // Filename line
    wlFilename=new Label(shell, SWT.RIGHT);
    wlFilename.setText("Filename");
     props.setLook(wlFilename);
    fdlFilename=new FormData();
    fdlFilename.left = new FormAttachment(0, 0);
    fdlFilename.top  = new FormAttachment(wS3Bucket, margin);
    fdlFilename.right= new FormAttachment(middle, -margin);
    wlFilename.setLayoutData(fdlFilename);
    wFilename=new TextVar(jobMeta, shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
     props.setLook(wFilename);
    wFilename.addModifyListener(lsMod);
    fdFilename=new FormData();
    fdFilename.left = new FormAttachment(middle, 0);
    fdFilename.top  = new FormAttachment(wS3Bucket, margin);
    fdFilename.right= new FormAttachment(100, 0);
    wFilename.setLayoutData(fdFilename);
   
   
    //Buttons
    wOK=new Button(shell, SWT.PUSH);
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.