Package org.eclipse.swt.layout

Examples of org.eclipse.swt.layout.RowData


  }
 
  public static void getSeparator(Composite cmp) {   
   
    final Canvas ctrl = new Canvas(cmp, SWT.BORDER_SOLID);
    ctrl.setLayoutData(new RowData(20, iconSize));
    ctrl.addPaintListener(new PaintListener() {
      public void paintControl(PaintEvent e) {
        e.gc.drawLine(2, iconSize/2-2, 15, iconSize/2-2);
        e.gc.drawLine(2, iconSize/2+2, 15, iconSize/2+2);
        e.gc.drawLine(15, iconSize/2-5, 19, iconSize/2);
View Full Code Here


      //name
      Composite nameComposite = new Composite(composite, SWT.NONE);
      nameComposite.setLayout( new RowLayout(SWT.HORIZONTAL));
      Label nameLabel = new Label(nameComposite, SWT.NONE);
      nameLabel.setText("name:");  
      nameLabel.setLayoutData( new RowData(labelWidth, labelHeight));
      for (Element element : elementsToCompare){
        EmbeddedLink link = new EmbeddedLink(nameComposite, SWT.NONE, false);
        String attributeValue = accessLayer.getAttributeValue(element, "name");
        link.setText(attributeValue!=null? attributeValue : "");
        link.setLayoutData( new RowData(linkWidth, linkHeight));
        link.setTarget(element);
      }

     
      //attributes
      for (EAttribute eAttribute : attributesToCompare ){
        Composite attributeComposite = new Composite(composite, SWT.NONE);
        attributeComposite.setLayout( new RowLayout(SWT.HORIZONTAL));
        if (eAttribute.getName() != "name"){
   
        Label label = new Label(attributeComposite, SWT.NONE);
        label.setText(eAttribute.getName()+":");  
        label.setLayoutData( new RowData(labelWidth, labelHeight));
        int maxLength = 0;
        for (Element element : elementsToCompare){
          String attributeValue = accessLayer.getAttributeValue(element, eAttribute.getName());
          maxLength = Math.max(maxLength, (attributeValue!=null? attributeValue : "").length());
        }
       
        for (Element element : elementsToCompare){
         
          Text text = new Text(attributeComposite, SWT.BORDER | SWT.READ_ONLY | SWT.MULTI| SWT.WRAP);
          String attributeValue = accessLayer.getAttributeValue(element, eAttribute.getName());
          text.setText(attributeValue!=null? attributeValue : "");
          text.setLayoutData( new RowData(textboxWidth, textboxHeight));
         
          text.setToolTipText("the "+eAttribute.getName() +" of the element " + accessLayer.getAttributeValue(element, "name"));
         
          }
        }
      }

         
         
       
          ///parent Preconditions
      Composite parentPreconditionsComposite = new Composite(composite, SWT.NONE);
      parentPreconditionsComposite.setLayout( new RowLayout(SWT.HORIZONTAL));
      Label parentPreconditionLabel = new Label(parentPreconditionsComposite, SWT.NONE);
      parentPreconditionLabel.setLayoutData( new RowData(labelWidth, labelHeight));

      parentPreconditionLabel.setText("foreign preconditions:");
     
      for (Element element : elementsToCompare){
       
        Text text = new Text(parentPreconditionsComposite, SWT.BORDER | SWT.READ_ONLY | SWT.MULTI| SWT.WRAP);
        String precoditionString = PreconditionFinder.getRequirementsFromParent(element, cacheManager);
        text.setText(precoditionString!=null && precoditionString!=""? precoditionString : "none");
        text.setLayoutData( new RowData(textboxWidth, textboxHeight));
        text.setToolTipText("foreign preconditions of the element " + accessLayer.getAttributeValue(element, "name"));
        }
     
          ///Preconditions
      Composite preconditionsComposite = new Composite(composite, SWT.NONE);
      preconditionsComposite.setLayout( new RowLayout(SWT.HORIZONTAL));
      Label preconditionLabel = new Label(preconditionsComposite, SWT.NONE);
      preconditionLabel.setLayoutData( new RowData(labelWidth, labelHeight ));
      preconditionLabel.setText("own preconditions:");
     
      for (Element element : elementsToCompare){
       
        Text text = new Text(preconditionsComposite, SWT.BORDER | SWT.READ_ONLY | SWT.MULTI| SWT.WRAP);
        String precoditionString = PreconditionFinder.formatConditionString(((ConstrainedElement)element).getPrecondition());
        text.setText(precoditionString!=null && precoditionString!=""? precoditionString : "none");
        text.setLayoutData( new RowData(textboxHeight, textboxWidth));
        text.setToolTipText("own preconditions of the element " + accessLayer.getAttributeValue(element, "name"));
        }

    ////////////
   
View Full Code Here

  /**
   * create the required controls
   */
  protected void createPartsForContraints() {
    baseComposite.setLayout(new RowLayout(SWT.HORIZONTAL));
    baseComposite.setLayoutData(new RowData(690, 70));
    addTitle();
    bodyComposite = new Composite(baseComposite, SWT.NONE);
    bodyComposite.setLayoutData(new RowData(690, 40));
    addBody();
  }
View Full Code Here

    Composite composite = new Composite(baseComposite, SWT.NONE);
    composite.setLayout(new RowLayout(SWT.HORIZONTAL));
    composite.setBackground(Display.getDefault().getSystemColor(
        SWT.COLOR_WIDGET_LIGHT_SHADOW));
    composite.setLayoutData(new RowData(690, 30));
    final EmbeddedLink link = new EmbeddedLink(composite, SWT.NONE, false);
    // add link
    link.setTarget(property);
    if (property.getName() != null)
      link.setText(property.getName());
    else
      link.setText("");

    link.setLayoutData(new RowData(650, 25));

    property.addModelElementChangeListener(new ModelElementChangeListener() {

      @Override
      public void onChange(final Notification notification) {
        if (notification.getEventType() == Notification.SET)
          if (notification.getFeature().getClass().getName() == "name") {
            Display.getDefault().asyncExec(new Runnable() {

              @Override
              public void run() {
                link.setText(notification.getNewStringValue());
              }
            });
          } else if (notification.getFeature().getClass().getName() == "description") {
            Display.getDefault().asyncExec(new Runnable() {

              @Override
              public void run() {
                link.setTargetDescription(notification
                    .getNewStringValue());
              }
            });
          }

      }

      @Override
      public void onRuntimeExceptionInListener(RuntimeException exception) {

      }

    });
    // add delete button
    Button deleteButton = new Button(composite, SWT.None);
    deleteButton.setImage(PlatformUI.getWorkbench().getSharedImages()
        .getImage(ISharedImages.IMG_TOOL_DELETE));
    deleteButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false,
        false, 1, 1));
    deleteButton.setToolTipText("delete this assigned contraint");
    deleteButton.setLayoutData(new RowData(25, 25));
    deleteButton.setBackground(deleteButton.getParent().getBackground());
    deleteButton.addSelectionListener(new SelectionListener() {

      @Override
      public void widgetSelected(SelectionEvent e) {
View Full Code Here

    newTargetMenuItem = new MenuItem(menu, SWT.PUSH);
    newTargetMenuItem.setText("selet new target");

    captionLink.setMenu(menu);
    captionLink.pack();
    captionLink.setLayoutData(new RowData(678,25));
   
    deleteButton = new Button(this.headComposite, SWT.FLAT);
    deleteButton.setLayoutData(new RowData(25, 25));
    deleteButton.setBackground(deleteButton.getParent().getBackground());
   
    textComposite = new Composite(getBaseComposite(), SWT.BORDER);
    textComposite.setLayout(new RowLayout(SWT.HORIZONTAL));
   
    textComposite.setBackground(textComposite.getParent().getBackground());

    text = new LinkedText(this.textComposite,  SWT.V_SCROLL);

    text.setWordWrap(true);
    text.setLayoutData(new RowData(684, 50));
  }
View Full Code Here

    editorComposite.setToolTipText(headComposite.getToolTipText());
    editorComposite.setBackground(headComposite.getParent().getBackground());
   
    descriptionText = new LinkedText(editorComposite, SWT.BORDER | SWT.V_SCROLL);
    descriptionText.setWordWrap(true);
    descriptionText.setLayoutData(new RowData(689,50));
    descriptionText.setToolTipText("please enter here the description for the strategy");
   
    typeLabel = new Label(headComposite, SWT.NONE);
    typeLabel.setBackground(headComposite.getBackground());
    typeLabel.setText("Strategy");
    typeLabel.setLayoutData(new RowData(75,25));
   
    captionText = new TextEdit(headComposite, SWT.BORDER | SWT.SINGLE);
    captionText.setToolTipText("please enter here the name for the strategy");
    captionText.setLayoutData(new RowData(593,25));

    deleteButton = new Button(headComposite, SWT.FLAT);
    deleteButton.setToolTipText("delete the strategy");
    deleteButton.setLayoutData(new RowData(25,25));

  }
View Full Code Here

    influenceText.setCPListProvider(influenceCPListProvider)
   
    //set width & height for input fields
    int editorWidth = 683 - level * 6;
    int inteditorHeight = 50;
    descriptionText.setLayoutData(new RowData(editorWidth, inteditorHeight));
    flexibilityText.setLayoutData(new RowData(editorWidth, inteditorHeight));
    changeabilityText.setLayoutData(new RowData(editorWidth, inteditorHeight));
    influenceText.setLayoutData(new RowData(editorWidth, inteditorHeight));
   
    captionText.setLayoutData(new RowData(300 - level * 6, 25));
  }
View Full Code Here

   
    numberLabel = new Label(captionComposite, SWT.NONE);
    numberLabel.setBackground(numberLabel.getParent().getBackground());
    numberLabel.setToolTipText("the numbering of the factor");

    numberLabel.setLayoutData(new RowData(100, 25));
    typeLabel.setLayoutData(new RowData(100, 25));
   
    captionText = new TextEdit(captionComposite, SWT.BORDER | SWT.SINGLE);
    captionText.setToolTipText("please enter here the name of the factor");   
   
    Label descriptionLabel = new Label(editorComposite, SWT.None);
    descriptionLabel.setText("description");
    descriptionLabel.setBackground(descriptionLabel.getParent().getBackground());
   
    descriptionText = new LinkedText(editorComposite, SWT.V_SCROLL | SWT.BORDER);
    descriptionText.setToolTipText("please enter here the description of the factor");
    descriptionText.setWordWrap(true);
   
    Label flexibilityLabel = new Label(editorComposite, SWT.None);
    flexibilityLabel.setText("flexibility");
    flexibilityLabel.setBackground(flexibilityLabel.getParent().getBackground());
   
    flexibilityText = new LinkedText(editorComposite, SWT.V_SCROLL | SWT.BORDER );
    flexibilityText.setToolTipText("please enter here the flexibility of the factor");
    flexibilityText.setWordWrap(true);
   
    Label changeabilityLabel = new Label(editorComposite, SWT.None);
    changeabilityLabel.setText("changeability");
    changeabilityLabel.setBackground(changeabilityLabel.getParent().getBackground());
     
    changeabilityText = new LinkedText(editorComposite, SWT.V_SCROLL | SWT.BORDER);
    changeabilityText.setToolTipText("please enter here the changeability of the factor");   
    changeabilityText.setWordWrap(true);
   
    Label influenceLabel = new Label(editorComposite, SWT.None);
    influenceLabel.setText("influence");
    influenceLabel.setBackground(influenceLabel.getParent().getBackground());
   
    influenceText = new LinkedText(editorComposite, SWT.V_SCROLL | SWT.BORDER);
    influenceText.setToolTipText("please enter here the influence of the factor");
    influenceText.setWordWrap(true);
   
    priorityLabel = new Label(captionComposite, SWT.NONE);
    priorityLabel.setBackground(captionComposite.getBackground());
    priorityLabel.setText("priority");
    priorityLabel.setBackground(priorityLabel.getParent().getBackground());
    priorityLabel.setLayoutData(new RowData(40, 25));

   
    priorityCombo = new Combo (captionComposite, SWT.READ_ONLY);
    priorityCombo.setItems (new String [] {"hightest", "high", "normal", "low", "lowest"});
    priorityCombo.setToolTipText("the priority of the factor");
    priorityCombo.setLayoutData(new RowData(50, 25));
    priorityLabel.setToolTipText(priorityCombo.getToolTipText());
   
    newButton = new Button(captionComposite, SWT.FLAT);
    newButton.setText("new");
    newButton.setToolTipText("add a new factor or factor category");
    newButton.setBackground(newButton.getParent().getBackground());
    newButton.setLayoutData(new RowData(35, 25));

    deleteButton = new Button(captionComposite, SWT.FLAT);
    deleteButton.setToolTipText("delete the factor");
    deleteButton.setBackground(deleteButton.getParent().getBackground());
    deleteButton.setLayoutData(new RowData(25, 25));
  }
View Full Code Here

    getBaseComposite().setLayout(new RowLayout());
   
    label = new Label(getBaseComposite(), SWT.NONE);
    editor = new LinkedText(getBaseComposite(), SWT.V_SCROLL | SWT.BORDER);
    editor.setWordWrap(true);
    editor.setLayoutData(new RowData(687, 50))
  }
View Full Code Here

     * @param level the level of the entry at an FactorTable
   */
  public FactorCategoryPart(Composite parent, int level){
    super(parent, level);
    //after createControls()
    captionText.setLayoutData(new RowData(422 - level * 6, 25));
  }
View Full Code Here

TOP

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

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.