Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.Composite


    }
    return messages;
  }

  public void createControl(Composite parent) {
    Composite container = new Composite(parent, SWT.NULL);
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    container.setLayout(layout);
    new Label(container, SWT.NONE).setText("Module name for the outerlayout:");
    _txtOuterLayoutName = new Text(container, SWT.BORDER);
    _txtOuterLayoutName.setText(DEFAULT_OUTERLAYOUT_NAME);
    _txtOuterLayoutName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    _txtOuterLayoutName.addModifyListener(this);
View Full Code Here


  public void createToolbar(Composite parent) {     
  }

    @Override
    protected ISourceViewer createSourceViewer(Composite parent, IVerticalRuler ruler, int styles) {
        Composite composite= new Composite(parent, SWT.NONE);
        GridLayout layout= new GridLayout(1, false);
        layout.marginHeight= 0;
        layout.marginWidth= 0;
        layout.horizontalSpacing= 0;
        layout.verticalSpacing= 0;
        composite.setLayout(layout);

       
       
       
        _toolbarComposite= new Composite(composite, SWT.NONE);
        GridData layoutData= new GridData(SWT.FILL, SWT.TOP, true, false);
        //layoutData.heightHint = 39;
        _toolbarComposite.setLayoutData(layoutData);        
       
       
//       
//        layout= new GridLayout(1, false);
//        layout.marginHeight= 2;
//        layout.marginWidth= 2;
//        layout.horizontalSpacing= 0;
//        layout.verticalSpacing= 0;
//        _toolbarComposite.setLayout(layout);

        _toolbarComposite.addListener(SWT.Resize, new Listener() {
            public void handleEvent(Event event) {
                int height= _toolbarComposite.getClientArea().height;

                    Image image= createGradientImage(height, event.display);
                    _toolbarComposite.setBackgroundImage(image);

            }
        });
       
        //_toolbarComposite.setBackgroundImage(createGradientImage(39, Display.getCurrent()));
        _toolbarComposite.setBackgroundMode(SWT.INHERIT_DEFAULT);
       
        createToolbar(_toolbarComposite);
        ((GridData) _toolbarComposite.getLayoutData()).exclude= true;
        _toolbarComposite.setVisible(false);
  

        _editorComposite= new Composite(composite, SWT.NONE);
        _editorComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
        FillLayout fillLayout= new FillLayout(SWT.VERTICAL);
        fillLayout.marginHeight= 0;
        fillLayout.marginWidth= 0;
        fillLayout.spacing= 0;
View Full Code Here

    setTitle("Export WGA Design");
    setDescription("This wizard exports a WGA Design to the local filesystem.");
  }

  public void createControl(Composite parent) {   
    Composite container = new Composite(parent, SWT.NULL);
    GridLayout layout = new GridLayout();
    layout.numColumns = 3;
    container.setLayout(layout);
   
    Label lblFolder = new Label(container, SWT.None);
    lblFolder.setText("Design folder:");
    Label lblPath = new Label(container, SWT.None);
    lblPath.setText(_design.getLocation().toFile().getAbsolutePath());
View Full Code Here

       
    // encoder section
    Section section = toolkit.createSection(form.getBody(), Section.DESCRIPTION|Section.TITLE_BAR|Section.TWISTIE|Section.EXPANDED);
    section.setText("Design Shortcuts");

        Composite sectionClient = toolkit.createComposite(section);
        section.setClient(sectionClient);
        GridLayout sectionLayout = new GridLayout();
        GridData fillHSpan = new GridData(GridData.FILL_HORIZONTAL);
        fillHSpan.horizontalSpan = 4;
       
        GridData prefSize = new GridData();
        prefSize.widthHint = 50;
       
        sectionLayout.numColumns = 2;
        sectionClient.setLayout(sectionLayout);   
       
        // create Table
        _tblShortcuts = toolkit.createTable(sectionClient, SWT.BORDER|SWT.FULL_SELECTION);
        _tblShortcuts.setHeaderVisible(true);         
        GridData tblLayoutData = new GridData(GridData.FILL_BOTH);
View Full Code Here

     
        // mediakeys section
    Section section = toolkit.createSection(form.getBody(), Section.DESCRIPTION|Section.TITLE_BAR|Section.TWISTIE|Section.EXPANDED);
    section.setText("Media Keys");

        Composite sectionClient = toolkit.createComposite(section);
        section.setClient(sectionClient);     
        sectionClient.setLayout(sectionLayout);   
       
        // create Table media keys
        _tblMediaKeys = toolkit.createTable(sectionClient, SWT.BORDER|SWT.FULL_SELECTION);
        _tblMediaKeys.setHeaderVisible(true);         
        _tblMediaKeys.setLayoutData(GridDataFactory.copyData(tblLayoutData));  
        registerField("mediaKeys", _tblMediaKeys);
               
        _mediaKeyColumn = new TableColumn(_tblMediaKeys, SWT.NONE);               
        _mediaKeyColumn.setText("Key");
        _mediaKeyColumn.setWidth((int)(tableWidth * 0.25));
       
        _mediaMimeTypeColumn = new TableColumn(_tblMediaKeys, SWT.NONE)
        _mediaMimeTypeColumn.setText("Mime type");
        _mediaMimeTypeColumn.setWidth((int)(tableWidth * 0.25));
       
        _mediaBinaryColumn = new TableColumn(_tblMediaKeys, SWT.NONE)
        _mediaBinaryColumn.setText("Binary output");
        _mediaBinaryColumn.setWidth((int)(tableWidth * 0.25));

       
        _mediaHTTPLoginColumn = new TableColumn(_tblMediaKeys, SWT.NONE)
        _mediaHTTPLoginColumn.setText("Use HTTP login");
        _mediaHTTPLoginColumn.setWidth((int)(tableWidth * 0.25));

        _mediaKeysModel = new MediaKeysModel(_model.getMediaKeys());
        _mediaKeysModel.addListener(new BeanListTableModelListener() {

      public void add(Object bean) {
        _model.fireModelChanged();         
      }

      public void remove(Object bean) {
        _model.fireModelChanged();       
      }

      public void update(Object bean) {
        _model.fireModelChanged();         
      }
     
      @SuppressWarnings("unchecked")
      public void refresh(List beans) {
        _model.fireModelChanged();       
      }
         
        });
       
        _tblViewerMediaKeys = new TableViewer(_tblMediaKeys);
       
        CellEditor[] editors = new CellEditor[4];
        editors[0] = new TextCellEditor(_tblMediaKeys);
        editors[1] = new TextCellEditor(_tblMediaKeys);
        editors[2] = new CheckboxCellEditor(_tblMediaKeys, SWT.CENTER);       
        editors[3] = new CheckboxCellEditor(_tblMediaKeys, SWT.CENTER);
        _tblViewerMediaKeys.setCellEditors(editors);
       
        BeanListTableModelCellModifier modifier = new BeanListTableModelCellModifier(_tblViewerMediaKeys, _mediaKeysModel);
        modifier.setEditMode(2, BeanListTableModelCellModifier.EDIT_MODE_ON_SINGLE_CLICK);
        modifier.setEditMode(3, BeanListTableModelCellModifier.EDIT_MODE_ON_SINGLE_CLICK);
        _tblViewerMediaKeys.setCellModifier(modifier);
       
        _tblViewerMediaKeys.setContentProvider(new BeanListTableModelContentProvider());
        _tblViewerMediaKeys.setLabelProvider(new BeanListTableModelLabelProvider(_mediaKeysModel));
        _tblViewerMediaKeys.setInput(_mediaKeysModel)
       

        _btnAddMediaKey = toolkit.createButton(sectionClient, "add", SWT.PUSH);
        _btnAddMediaKey.setLayoutData(btnLayout);
        _btnAddMediaKey.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
      public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
        handleAddMediaKey();
      }

    });
       
        _btnRemoveMediaKey = toolkit.createButton(sectionClient, "remove", SWT.PUSH);
        _btnRemoveMediaKey.setLayoutData(btnLayout);
        _btnRemoveMediaKey.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
      public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
        handleRemoveMediaKey();
      }
    });
       
    // encoder section
    section = toolkit.createSection(form.getBody(), Section.DESCRIPTION|Section.TITLE_BAR|Section.TWISTIE|Section.COMPACT);
    section.setText("Encoder Mappings");

        sectionClient = toolkit.createComposite(section);
        sectionClient.setLayout(sectionLayout);
        section.setClient(sectionClient);
       
        // create Table encoder mappings
        _tblEncoderMappings = toolkit.createTable(sectionClient, SWT.BORDER|SWT.FULL_SELECTION);
        _tblEncoderMappings.setHeaderVisible(true);                 
        _tblEncoderMappings.setLayoutData(GridDataFactory.copyData(tblLayoutData));   
        registerField("encoderMappings", _tblEncoderMappings);
         
        _encoderNameColumn = new TableColumn(_tblEncoderMappings, SWT.NONE)
        _encoderNameColumn.setText("Encoder name");
        _encoderNameColumn.setWidth((int)(tableWidth * 0.5));
       
        _encoderImplClassColumn = new TableColumn(_tblEncoderMappings, SWT.NONE);
        _encoderImplClassColumn.setText("Implementation class");
        _encoderImplClassColumn.setWidth((int)(tableWidth * 0.5));         

        _encoderMappingsModel = new EncoderMappingsModel(_model.getEncoderMappings());
        _encoderMappingsModel.addListener(new BeanListTableModelListener() {

      public void add(Object bean) {
        _model.fireModelChanged();         
      }

      public void remove(Object bean) {
        _model.fireModelChanged();       
      }

      public void update(Object bean) {
        _model.fireModelChanged();         
      }     

      @SuppressWarnings("unchecked")
      public void refresh(List beans) {
        _model.fireModelChanged();       
      }
         
        });
       
        _tblViewerEncoderMappings = new TableViewer(_tblEncoderMappings);
       
        // text editors for both columns
        editors = new CellEditor[2];
        editors[0] = new TextCellEditor(_tblEncoderMappings);
        editors[1] = new TextCellEditor(_tblEncoderMappings);         
        _tblViewerEncoderMappings.setCellEditors(editors);
       
        _tblViewerEncoderMappings.setCellModifier(new BeanListTableModelCellModifier(_tblViewerEncoderMappings, _encoderMappingsModel));                                       
        _tblViewerEncoderMappings.setContentProvider(new BeanListTableModelContentProvider());
        _tblViewerEncoderMappings.setLabelProvider(new BeanListTableModelLabelProvider(_encoderMappingsModel));
        _tblViewerEncoderMappings.setInput(_encoderMappingsModel)
       
        _btnAddEncoderMapping = toolkit.createButton(sectionClient, "add", SWT.PUSH);
        _btnAddEncoderMapping.setLayoutData(btnLayout);
        _btnAddEncoderMapping.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
      public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
        handleAddEncoderMapping();
      }

    });
       
        _btnRemoveEncoderMapping = toolkit.createButton(sectionClient, "remove", SWT.PUSH);
        _btnRemoveEncoderMapping.setLayoutData(btnLayout);
      _btnRemoveEncoderMapping.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
      public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
        handleRemoveEncoderMapping();
      }
    });

     
      // element section
    section = toolkit.createSection(form.getBody(), Section.DESCRIPTION|Section.TITLE_BAR|Section.TWISTIE|Section.COMPACT);
    section.setText("Element Mappings");

        sectionClient = toolkit.createComposite(section);
        section.setClient(sectionClient);     
        sectionLayout.numColumns = 2;
        sectionClient.setLayout(sectionLayout);   
       
        // create Table element mappings
        _tblElementMappings = toolkit.createTable(sectionClient, SWT.BORDER|SWT.FULL_SELECTION);
        _tblElementMappings.setHeaderVisible(true);         
        _tblElementMappings.setLayoutData(GridDataFactory.copyData(tblLayoutData))
View Full Code Here

       
    // publisher options section
    Section section = toolkit.createSection(form.getBody(), Section.DESCRIPTION|Section.TITLE_BAR|Section.TWISTIE|Section.EXPANDED);
    section.setText("Publisher options");

        Composite sectionClient = toolkit.createComposite(section);
        section.setClient(sectionClient);
        GridLayout sectionLayout = new GridLayout();
        GridData fillHSpan = new GridData(GridData.FILL_HORIZONTAL);
        fillHSpan.horizontalSpan = 4;

        sectionLayout.numColumns = 1;
        sectionClient.setLayout(sectionLayout);   
       
        _tablePublisherOptions = new EditableTableControl<PublisherOption>(sectionClient,SWT.NONE, SWT.FULL_SELECTION|SWT.BORDER);
        GridData tablePublisherOptionsLayoutData = new GridData(GridData.FILL_BOTH);
        tablePublisherOptionsLayoutData.minimumHeight = 200;
        _tablePublisherOptions.setLayoutData(tablePublisherOptionsLayoutData);
       
    // create columns
    String[] columnNames = new String[] { "Name", "Value" };
   
    // create model
    _publisherOptionsModel = new PublisherOptionsModel(_model.getPublisherOptions());
   
    _publisherOptionsModel.addListener(new BeanListTableModelListener() {

      public void add(Object bean) {
        _model.fireModelChanged();         
      }

      public void remove(Object bean) {
        _model.fireModelChanged();       
      }

      public void update(Object bean) {
        _model.fireModelChanged();         
      }     

      @SuppressWarnings("unchecked")
      public void refresh(List beans) {
        //_model.fireModelChanged();       
      }
         
        });
   
    _tablePublisherOptions.init(columnNames, _publisherOptionsModel);

   
    CellEditor[] editors = new CellEditor[2];
        editors[0] = new TextCellEditor(_tablePublisherOptions.getTable());
        editors[1] = new TextCellEditor(_tablePublisherOptions.getTable());
    _tablePublisherOptions.getTableViewer().setCellEditors(editors);
   
    toolkit.adapt(_tablePublisherOptions.getButton(EditableTableControl.BUTTON_ADD), true, true);
    toolkit.adapt(_tablePublisherOptions.getButton(EditableTableControl.BUTTON_REMOVE), true, true);
   
    _tablePublisherOptions.getButton(EditableTableControl.BUTTON_ADD).addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
      public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
        handleAddPublisherOption();
      }
    });

    _tablePublisherOptions.getButton(EditableTableControl.BUTTON_REMOVE).addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
      public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
        handleRemovePublisherOption();
      }
    });
   
    _tablePublisherOptions.getTable().addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
        if (_tablePublisherOptions.getTable().getSelectionCount() > 0) {
          PublisherOption option = (PublisherOption) _tablePublisherOptions.getTable().getSelection()[0].getData();
          if (_publisherOptionsModel.isBeanEditable(option)) {
            _tablePublisherOptions.getButton(EditableTableControl.BUTTON_REMOVE).setEnabled(true);
          } else {
            _tablePublisherOptions.getButton(EditableTableControl.BUTTON_REMOVE).setEnabled(false);
          }
        }
      }
    });
       
       
    // remote actions section
    section = toolkit.createSection(form.getBody(), Section.DESCRIPTION|Section.TITLE_BAR|Section.TWISTIE|Section.EXPANDED);
    section.setText("Remote Actions");

        sectionClient = toolkit.createComposite(section);
        section.setClient(sectionClient);
        sectionLayout = new GridLayout();
        fillHSpan = new GridData(GridData.FILL_HORIZONTAL);
        fillHSpan.horizontalSpan = 4;
       
        GridData prefSize = new GridData();
        prefSize.widthHint = 50;
       
        sectionLayout.numColumns = 2;
        sectionClient.setLayout(sectionLayout);   
       
        // create Table for remote actions
        _tblRemoteActions = toolkit.createTable(sectionClient, SWT.BORDER|SWT.FULL_SELECTION);
        _tblRemoteActions.setHeaderVisible(true);         
        GridData tblLayoutData = new GridData(GridData.FILL_BOTH);
View Full Code Here

            return _value;
        }

        @Override
        protected Control createDialogArea(Composite parent) {
            Composite composite = new Composite(parent, SWT.NONE);
            GridData data = new GridData(GridData.FILL, GridData.FILL, true, true);
            data.minimumWidth = 500;
            data.minimumHeight = 200;
            composite.setLayoutData(data);
            composite.setLayout(new FillLayout());
            _text = new Text(composite, SWT.MULTI|SWT.V_SCROLL);
            _text.setText(_initialValue);
            return composite;
        }
View Full Code Here

    }
  }

  public void createControl(Composite parent) {
    Composite container = new Composite(parent, SWT.NULL);
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    layout.verticalSpacing = 9;
    container.setLayout(layout);
    Display display = getWizard().getContainer().getShell().getDisplay();
    new Label(container, SWT.NULL).setText("Portlet name:");

    _txtPortletName = new Text(container, SWT.BORDER);
    GridData txtStyle = new GridData(GridData.FILL_HORIZONTAL | SWT.LEFT);
View Full Code Here

        form.getBody().setLayout(layout);

        Section section = toolkit.createSection(form.getBody(), Section.DESCRIPTION | Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED);
        section.setText("Modules");

        Composite sectionClient = toolkit.createComposite(section);
        section.setClient(sectionClient);
        GridLayout sectionLayout = new GridLayout();
        GridData fillHSpan = new GridData(GridData.FILL_HORIZONTAL);
        fillHSpan.horizontalSpan = 4;

        GridData prefSize = new GridData();
        prefSize.widthHint = 500;

        sectionLayout.numColumns = 1;
        sectionClient.setLayout(sectionLayout);

        ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
        ToolBar toolbar = toolBarManager.createControl(section);

        Action action1 = new Action("refresh", Plugin.getDefault().getImageRegistry().getDescriptor(Plugin.IMAGE_REFRESH)) {
View Full Code Here

        _contentTypeDefinition = def;
    }

    @Override
    protected Control createDialogArea(Composite parent) {
        Composite composite = new Composite(parent, SWT.None);
        composite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
        GridLayout layout = new GridLayout(2, false);
        composite.setLayout(layout);
        new Label(composite, SWT.NONE).setText("Add properties to content type");
        new Label(composite, SWT.NONE);
       
        for (WGMetaFieldDefinition def : METADATA_DEFINITIONS.values()) {
            Button checkMetaData = new Button(composite, SWT.CHECK);
View Full Code Here

TOP

Related Classes of org.eclipse.swt.widgets.Composite

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.