Java Code Examples for org.eclipse.swt.widgets.List#setLayoutData()

The following examples show how to use org.eclipse.swt.widgets.List#setLayoutData() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: KeyValueListFieldEditor.java    From texlipse with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Creates and returns the contents of an area of the dialog which appears
 * below the message and above the button bar.
 * 
 * This implementation creates two labels and two textfields.
 * 
 * @param parent parent composite to contain the custom area
 * @return the custom area control, or <code>null</code>
 */
protected Control createCustomArea(Composite parent) {

    Composite composite = new Composite(parent, SWT.NULL);
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));
    composite.setLayout(new GridLayout());
    
    envVarList = new List(composite, SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
    envVarList.setLayoutData(new GridData(GridData.FILL_BOTH));
    envVarList.setItems(items);
    envVarList.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent event) {
            selections = envVarList.getSelectionIndices();
        }});
    
    return composite;
}
 
Example 2
Source File: CommandCategoryEditor.java    From e4macs with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * @see Dialog#createDialogArea(Composite)
 */
protected Control createDialogArea(Composite parent) {
	Composite result = new Composite(parent, SWT.NONE);
	result.setLayout(new GridLayout());
	result.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	catList = new List(result, SWT.BORDER | SWT.MULTI );
	catList.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	if (categoryArray != null){
		for (int i=0; i< categoryArray.size(); i++){
			catList.add(getLabel(categoryArray.get(i)));
		}
		catList.pack(true);
		catList.computeSize(SWT.DEFAULT, SWT.DEFAULT);
		catList.setVisible(true);
	} 
	result.setVisible(true);
	catList.addDisposeListener(new DisposeListener() {
		public void widgetDisposed(DisposeEvent e) {
			catList = null;
		}
	});
	return result;
}
 
Example 3
Source File: TexlipseProjectCreationWizardPage.java    From texlipse with Eclipse Public License 1.0 6 votes vote down vote up
/**
   * Creates a list element containing available templates (system and user)
   * and a text area next to it for showing description about the selected template
   * 
   * @param composite the parent container
   */
  private void createTemplateControl(Composite composite) {
      // add list for templates
      templateList = new List(composite, SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
templateList.setItems(ProjectTemplateManager.loadTemplateNames());
      templateList.setLayoutData(new GridData(GridData.FILL_VERTICAL));
      templateList.setToolTipText(TexlipsePlugin.getResourceString("projectWizardTemplateTooltip"));
      templateList.addSelectionListener(new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
          	attributes.setTemplate(templateList.getSelection()[0]);
          	updateEntries();
          }});
      
      templateList.setSelection(0);
      // this has to be done, because setSelection() doesn't generate an event
      attributes.setTemplate(templateList.getItem(0));

      
      // add TextField for the selected template's description
      descriptionField = new Text(composite, SWT.MULTI | SWT.BORDER);
      descriptionField.setToolTipText(TexlipsePlugin.getResourceString("projectWizardTemplateDescriptionTooltip"));
      descriptionField.setLayoutData(new GridData(GridData.FILL_BOTH));
      descriptionField.setEditable(false);
  }
 
Example 4
Source File: SWTFactory.java    From xds-ide with Eclipse Public License 1.0 6 votes vote down vote up
public static List createList(Composite parent, int hspan, int style, int nLines) {
	List l = new List(parent, style);
	l.setFont(parent.getFont());
    GC gc = new GC(l);
    int cyLine;
    try{
    	cyLine = gc.textExtent("Wq").y; //$NON-NLS-1$
    }
    finally{
    	gc.dispose();
    }
	GridData gd = new GridData(GridData.FILL_HORIZONTAL);
	gd.horizontalSpan = hspan;
	gd.heightHint = cyLine * nLines + 5;
	l.setLayoutData(gd);
	return l;
}
 
Example 5
Source File: SidebarPreferences.java    From elexis-3-core with Eclipse Public License 1.0 6 votes vote down vote up
@Override
protected Control createDialogArea(Composite parent){
	list = new List(parent, SWT.BORDER | SWT.SINGLE);
	list.setLayoutData(SWTHelper.getFillGridData(1, true, 1, true));
	IExtensionRegistry exr = Platform.getExtensionRegistry();
	IExtensionPoint exp = exr.getExtensionPoint(ExtensionPointConstantsUi.SIDEBAR);
	if (exp != null) {
		IExtension[] extensions = exp.getExtensions();
		for (IExtension ex : extensions) {
			IConfigurationElement[] elems = ex.getConfigurationElements();
			for (IConfigurationElement el : elems) {
				String name = el.getAttribute("name"); //$NON-NLS-1$
				String ID = el.getAttribute("ID"); //$NON-NLS-1$
				list.add(name + ":" + ID); //$NON-NLS-1$
			}
		}
	}
	
	return list;
}
 
Example 6
Source File: AddTypeToPriorityListDialog.java    From uima-uimaj with Apache License 2.0 6 votes vote down vote up
@Override
protected Control createDialogArea(Composite parent) {
  // create composite
  Composite composite = (Composite) super.createDialogArea(parent);

  typeList = new List(composite, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL);
  GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
  gridData.heightHint = 100;
  typeList.setLayoutData(gridData);

  for (int i = 0; i < m_availableTypeNames.length; i++) {
    typeList.add(m_availableTypeNames[i]);
  }

  return composite;
}
 
Example 7
Source File: ImageBuilder.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
private void buildEmbeddedImageList( )
{
	embeddedImageList = new List( inputArea, SWT.NONE
			| SWT.SINGLE
			| SWT.BORDER
			| SWT.V_SCROLL
			| SWT.H_SCROLL );
	embeddedImageList.setLayoutData( new GridData( GridData.FILL_BOTH ) );
	embeddedImageList.addSelectionListener( new SelectionAdapter( ) {

		public void widgetSelected( SelectionEvent event )
		{
			preview( );
			modifyDialogContent( );
			updateButtons( );
		}
	} );

	initList( );
}
 
Example 8
Source File: CustomFilterDialog.java    From tmxeditor8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 初始化自定义过滤器列表
 * @param comp
 *            父容器
 */
private void initCustomFilterList(Composite comp) {
	customFilterList = new List(comp, SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER);
	GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1);
	gridData.widthHint = 110;
	gridData.heightHint = 250;
	customFilterList.setLayoutData(gridData);
	setListData(customFilterList, customFilters);
	customFilterList.addMouseListener(new MouseAdapter() {
		@Override
		public void mouseDoubleClick(MouseEvent e) {
			edit();
		}

	});
}
 
Example 9
Source File: DocumentPropertySection.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
private ListViewer createList(final Composite mainComposite) {
    final List list = getWidgetFactory().createList(mainComposite,
            SWT.FULL_SELECTION | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI);
    list.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());
    final ListViewer documentListViewer = new ListViewer(list);
    documentListViewer.setLabelProvider(new ElementForIdLabelProvider());
    documentListViewer.setContentProvider(new ObservableListContentProvider());
    documentListViewer.addDoubleClickListener(this);
    documentListViewer.addSelectionChangedListener(this);
    documentListViewer.getList().addKeyListener(new KeyAdapter() {

        @Override
        public void keyPressed(KeyEvent e) {
            if (e.keyCode == SWT.DEL) {
                e.doit = false;
                removeDocuments();
            }
        }
    });

    return documentListViewer;
}
 
Example 10
Source File: CustomFilterDialog.java    From translationstudio8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 初始化自定义过滤器列表
 * @param comp
 *            父容器
 */
private void initCustomFilterList(Composite comp) {
	customFilterList = new List(comp, SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER);
	GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1);
	gridData.widthHint = 110;
	gridData.heightHint = 250;
	customFilterList.setLayoutData(gridData);
	setListData(customFilterList, customFilters);
	customFilterList.addMouseListener(new MouseAdapter() {
		@Override
		public void mouseDoubleClick(MouseEvent e) {
			edit();
		}

	});
}
 
Example 11
Source File: MultipleSelectionCombo.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
private void initFloatShell() {
  Point p = displayText.getParent().toDisplay( displayText.getLocation() );
  Point size = displayText.getSize();
  Rectangle shellRect = new Rectangle( p.x, p.y + size.y, size.x, 0 );
  floatShell = new Shell( MultipleSelectionCombo.this.getShell(),
          SWT.NO_TRIM );

  GridLayout gl = new GridLayout();
  gl.marginBottom = 2;
  gl.marginTop = 2;
  gl.marginRight = 0;
  gl.marginLeft = 0;
  gl.marginWidth = 0;
  gl.marginHeight = 0;
  floatShell.setLayout( gl );

  list = new List( floatShell, SWT.BORDER | SWT.MULTI | SWT.H_SCROLL
          | SWT.V_SCROLL );
  for ( String value : comboItems ) {
    list.add( value );
  }

  GridData gd = new GridData( GridData.FILL_BOTH );
  list.setLayoutData( gd );
  floatShell.setSize( shellRect.width, 100 );
  floatShell.setLocation( shellRect.x, shellRect.y );
  list.addMouseListener( new MouseAdapter() {
    @Override
    public void mouseUp( MouseEvent event ) {
      super.mouseUp( event );
      comboSelection = list.getSelectionIndices();
      displayText();
    }
  } );

  floatShell.open();
}
 
Example 12
Source File: CustomMatchConditionDialog.java    From translationstudio8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 初始化已保存的条件列表
 * @param comp 父容器
 */
private void initCustomFilterList(Composite comp) {
	customFilterList = new List(comp, SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER);
	customFilterList.setLayoutData(new GridData(GridData.FILL_BOTH));
	setListData(customFilterList, customFilters);
	customFilterList.addMouseListener(new MouseAdapter() {
		@Override
		public void mouseDoubleClick(MouseEvent e) {
			// 调编辑的方法
			edit();
		}

	});
}
 
Example 13
Source File: EnvironmentTabWrapper.java    From ermasterr with Apache License 2.0 5 votes vote down vote up
private void createEnvironmentGroup(final Composite parent) {
    final GridData gridData = new GridData();
    gridData.horizontalAlignment = GridData.FILL;
    gridData.grabExcessHorizontalSpace = true;
    gridData.horizontalSpan = 3;
    gridData.heightHint = LIST_HEIGHT;

    environmentList = new List(parent, SWT.BORDER | SWT.V_SCROLL);
    environmentList.setLayoutData(gridData);
}
 
Example 14
Source File: VarTypeDialog.java    From Rel with Apache License 2.0 4 votes vote down vote up
/**
 * Create contents of the dialog.
 */
private void createContents() {
	shlVariableTypeAndName = new Shell(getParent(), getStyle());
	shlVariableTypeAndName.setSize(550, 320);
	shlVariableTypeAndName.setText("Variable Type and Name");
	shlVariableTypeAndName.setLayout(new FormLayout());

	Label lblChooseTheKind = new Label(shlVariableTypeAndName, SWT.NONE);
	FormData fd_lblChooseTheKind = new FormData();
	fd_lblChooseTheKind.left = new FormAttachment(0, 10);
	fd_lblChooseTheKind.top = new FormAttachment(0, 10);
	fd_lblChooseTheKind.bottom = new FormAttachment(0, 24);
	fd_lblChooseTheKind.right = new FormAttachment(100, -10);
	lblChooseTheKind.setLayoutData(fd_lblChooseTheKind);
	lblChooseTheKind.setText("Choose the kind of variable you wish to create.");

	List listVarType = new List(shlVariableTypeAndName, SWT.BORDER);
	FormData fd_listVarType = new FormData();
	fd_listVarType.top = new FormAttachment(lblChooseTheKind, 6);
	fd_listVarType.left = new FormAttachment(0, 10);
	fd_listVarType.right = new FormAttachment(100, -10);
	listVarType.setLayoutData(fd_listVarType);

	if (lastVariableType == null)
		lastVariableType = "REAL";
	int index = 0;
	for (String relvarType : database.getRelvarTypes()) {
		listVarType.add(relvarType);
		if (getVarTypeCode(relvarType).equalsIgnoreCase(lastVariableType))
			listVarType.setSelection(index);
		index++;
	}

	Button btnCancel = new Button(shlVariableTypeAndName, SWT.NONE);
	FormData fd_btnCancel = new FormData();
	fd_btnCancel.bottom = new FormAttachment(100, -10);
	fd_btnCancel.right = new FormAttachment(100, -10);
	btnCancel.setLayoutData(fd_btnCancel);
	btnCancel.setText("Cancel");

	Button btnOk = new Button(shlVariableTypeAndName, SWT.NONE);
	FormData fd_btnOk = new FormData();
	fd_btnOk.bottom = new FormAttachment(100, -10);
	fd_btnOk.right = new FormAttachment(btnCancel, -10);
	btnOk.setLayoutData(fd_btnOk);
	btnOk.setText("Ok");

	fd_listVarType.bottom = new FormAttachment(btnCancel, -10);

	listVarType.addListener(SWT.Selection, e -> variableType = obtainSelectedType(listVarType));

	btnCancel.addListener(SWT.Selection, e -> {
		variableType = null;
		shlVariableTypeAndName.dispose();
	});

	btnOk.addListener(SWT.Selection, e -> {
		variableType = obtainSelectedType(listVarType);
		shlVariableTypeAndName.dispose();
	});

	listVarType.addListener(SWT.MouseDoubleClick, e -> {
		variableType = obtainSelectedType(listVarType);
		shlVariableTypeAndName.dispose();
	});

}
 
Example 15
Source File: TmxConvert2FileDialog.java    From tmxeditor8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * (non-Javadoc)
 * @see net.heartsome.cat.common.ui.dialog.HsAbstractProgressDialog#createClientArea(org.eclipse.swt.widgets.Composite)
 */
@Override
public Composite createClientArea(Composite clientContainer) {
	Composite parent = clientContainer;
	parent.setLayout(new GridLayout(2, false));
	// 1、创建转换列表区域
	Label converTmxsLable = new Label(parent, SWT.NONE);
	converTmxsLable.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1));
	converTmxsLable.setText(Messages.getString("dialog.TmxConvert2FileDialog.waitlist"));
	new Label(parent, SWT.NONE);
	// list
	tmxList = new List(parent, SWT.BORDER | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
	tmxList.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

	// 2 、创建操作转换列表区域的按钮
	Composite composite = new Composite(parent, SWT.NONE);
	GridLayout rowLayout = new GridLayout(1, false);
	rowLayout.marginRight = 0;
	rowLayout.verticalSpacing = 10;
	composite.setLayout(rowLayout);
	composite.setLayoutData(new GridData(GridData.FILL_VERTICAL));
	// add
	addTmxBtn = new Button(composite, SWT.NONE);
	addTmxBtn.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	addTmxBtn.setText(Messages.getString("dialog.TmxConvert2FileDialog.add"));
	// remove
	removeTmxBtn = new Button(composite, SWT.NONE);
	removeTmxBtn.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	removeTmxBtn.setText(Messages.getString("dialog.TmxConvert2FileDialog.remove"));

	// 3、文件类型选择区域
	Composite fileTypeSelectArea = new Composite(parent, SWT.NONE);
	GridLayout gridLayout = new GridLayout(2, false);
	gridLayout.marginWidth = 0;
	fileTypeSelectArea.setLayout(gridLayout);
	fileTypeSelectArea.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1));

	Label lblNewLabel_1 = new Label(fileTypeSelectArea, SWT.NONE);
	lblNewLabel_1.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
	lblNewLabel_1.setText(Messages.getString("dialog.TmxConvert2FileDialog.convertto"));
	// type
	fileTypeCombo = new Combo(fileTypeSelectArea, SWT.READ_ONLY);
	fileTypeCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
	new Label(parent, SWT.NONE);

	// 4、转换属性选择区域
	propertyCheckBtn = new Button(parent, SWT.CHECK);
	propertyCheckBtn.setText(Messages.getString("dialog.TmxConvert2FileDialog.needproperty"));
	new Label(parent, SWT.NONE);

	// 5、存储路径选择区域
	Group savaPathGroup = new Group(parent, SWT.NONE);
	GridLayout saveLayout = new GridLayout(1, false);
	saveLayout.marginLeft = 0;
	savaPathGroup.setLayout(saveLayout);

	savaPathGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	savaPathGroup.setText(Messages.getString("dialog.TmxConvert2FileDialog.path"));
	// 源文件
	srcBtn = new Button(savaPathGroup, SWT.RADIO);
	srcBtn.setText(Messages.getString("dialog.TmxConvert2FileDialog.srcpath"));

	Composite saveAsComposite = new Composite(savaPathGroup, SWT.NONE);
	GridLayout layout = new GridLayout(3, false);
	layout.marginLeft = -5;
	saveAsComposite.setLayout(layout);
	GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
	saveAsComposite.setLayoutData(gridData);
	// 另存为
	saveAsBtn = new Button(saveAsComposite, SWT.RADIO);
	saveAsBtn.setText(Messages.getString("dialog.TmxConvert2FileDialog.saveaspath"));
	// filePath
	text = new Text(saveAsComposite, SWT.BORDER);
	text.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));

	browserBtn = new Button(saveAsComposite, SWT.NONE);
	browserBtn.setText(Messages.getString("dialog.TmxConvert2FileDialog.browser"));

	// 6、 初始化数据以及按钮状态
	setInitState();
	addListener();
	loadDialogSettings();
	return clientContainer;
}
 
Example 16
Source File: SWTListBoxWidget.java    From atdl4j with MIT License 4 votes vote down vote up
public Widget createWidget(Composite parent, int style)
{
	String tooltip = getTooltip();
	GridData controlGD = new GridData( SWT.FILL, SWT.TOP, false, false );
	
	// label
	if ( control.getLabel() != null ) {
		label = new Label( parent, SWT.NONE );
		label.setText( control.getLabel() );
		if ( tooltip != null ) label.setToolTipText( tooltip );
		label.setLayoutData( new GridData( SWT.LEFT, SWT.TOP, false, false ) );
		controlGD.horizontalSpan = 1;
	} else {
		controlGD.horizontalSpan = 2;
	}

	// dropDownList
	style = style | SWT.BORDER;
	if ( control instanceof MultiSelectListT )
	{
		style |= SWT.MULTI;
	}
	else if ( control instanceof SingleSelectListT )
	{
		style |= SWT.SINGLE;
	}
	listBox = new List( parent, style );
	listBox.setLayoutData( controlGD );

	// listBox items
	java.util.List<ListItemT> listItems = control instanceof MultiSelectListT ? ( (MultiSelectListT) control ).getListItem()
			: ( (SingleSelectListT) control ).getListItem();
	for ( ListItemT listItem : listItems )
	{
		listBox.add( listItem.getUiRep() );
	}

	// tooltip
	if ( tooltip != null ) listBox.setToolTipText( tooltip );

	// init value
	String initValue = (String) ControlHelper.getInitValue( control, getAtdl4jOptions() );
	if ( initValue != null )
		setValue( initValue, true );

	return parent;
}
 
Example 17
Source File: SeriesPagePie.java    From slr-toolkit with Eclipse Public License 1.0 4 votes vote down vote up
public SeriesPagePie(Composite parent, int style) {
	super(parent, style);
	setLayout(new GridLayout(1, false));
	
	compositeFirst = new Composite(this, SWT.NONE);
	compositeFirst.setLayout(new GridLayout(2, false));
	compositeFirst.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
	
	btnNewButton = new Button(compositeFirst, SWT.NONE);
	btnNewButton.setText("Select Term");
	
	lblSelectedTermIs = new Label(compositeFirst, SWT.CENTER);
	GridData gd_lblSelectedTermIs = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
	gd_lblSelectedTermIs.widthHint = 367;
	lblSelectedTermIs.setLayoutData(gd_lblSelectedTermIs);
	lblSelectedTermIs.setText("No Term Selected");
	btnNewButton.addSelectionListener(this);
	
	
	
	Composite compositeCentre = new Composite(this, SWT.NONE);
	compositeCentre.setLayout(new GridLayout(1, false));
	compositeCentre.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, true, true, 1, 1));
	
	list = new List(compositeCentre, SWT.BORDER | SWT.V_SCROLL);
	GridData gd_list = new GridData(SWT.LEFT, SWT.FILL, true, true, 1, 1);
	gd_list.widthHint = 400;
	list.setLayoutData(gd_list);
	list.setBounds(0, 0, 71, 68);
	list.addSelectionListener(this);
	
	Composite compositeNorth = new Composite(this, SWT.NONE);
	compositeNorth.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1));
	FillLayout fl_compositeNorth = new FillLayout(SWT.HORIZONTAL);
	fl_compositeNorth.marginWidth = 5;
	fl_compositeNorth.spacing = 5;
	compositeNorth.setLayout(fl_compositeNorth);
	
	lblColor = new Label(compositeNorth, SWT.NONE);
	lblColor.setText("Color:");
	
	btnRadioButtonGrey = new Button(compositeNorth, SWT.RADIO);
	btnRadioButtonGrey.setText("Grey");
	btnRadioButtonGrey.addSelectionListener(this);
	
	btnRadioButtonCustom = new Button(compositeNorth, SWT.RADIO);
	btnRadioButtonCustom.setText("Custom");
	btnRadioButtonCustom.addSelectionListener(this);
	
	btnRadioButtonRandom = new Button(compositeNorth, SWT.RADIO);
	btnRadioButtonRandom.setSelection(true);
	btnRadioButtonRandom.setText("Random");
	
	btnOneColor = new Button(compositeNorth, SWT.RADIO);
	btnOneColor.setText("One Color");
	btnOneColor.addSelectionListener(this);
	
	btnRadioButtonRandom.addSelectionListener(this);
	
	Composite compositeSouth = new Composite(this, SWT.NONE);
	compositeSouth.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
	compositeSouth.setLayout(new GridLayout(5, false));
	
	btnCheckButton = new Button(compositeSouth, SWT.CHECK);
	btnCheckButton.setBounds(0, 0, 111, 20);
	btnCheckButton.setText("Show in Chart");
	btnCheckButton.addSelectionListener(this);
	
	labelShowColor = new Label(compositeSouth, SWT.BORDER);
	GridData gd_labelShowColor = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
	gd_labelShowColor.widthHint = 100;
	labelShowColor.setLayoutData(gd_labelShowColor);
	labelShowColor.setBounds(0, 0, 70, 20);
	labelShowColor.setText(" ");
	labelShowColor.addMouseListener(this);
	new Label(compositeSouth, SWT.NONE);
	new Label(compositeSouth, SWT.NONE);
	new Label(compositeSouth, SWT.NONE);
	
	loadSettings();

}
 
Example 18
Source File: PickTaeForTypesDialog.java    From uima-uimaj with Apache License 2.0 4 votes vote down vote up
@Override
protected Control createDialogArea(Composite parent) {
  Composite composite = (Composite) super.createDialogArea(parent);
  Label specialMsgLabel = new Label(composite, SWT.WRAP);
  AbstractSection.spacer(composite);

  // create m_taePrompt
  createWideLabel(composite, "Delegate Components:");

  delegateComponentListGUI = new List(composite, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL);
  GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
  gridData.heightHint = 100;
  delegateComponentListGUI.setLayoutData(gridData);
  boolean bContainsConstituentsAlreadyInAggregate = false;
  boolean bContainsAggregate = false;
  for (int i = 0; i < m_DelegateComponentDescriptors.size(); i++) {
    String sAdditional = "";
    if (m_aggregateFileName.equals(m_DelegateComponentDescriptors.get(i))) {
      sAdditional = "**";
      bContainsAggregate = true;
    }
    delegateComponentListGUI.add((String) m_DelegateComponentDescriptors.get(i) + sAdditional);
  }
  delegateComponentListGUI.addSelectionListener(dialogSelectionListener);

  if (bContainsConstituentsAlreadyInAggregate && bContainsAggregate) {
    specialMsgLabel
            .setText("(* indicates delegate component is already part of aggregate, ** is aggregate currently being configured)");
  } else if (bContainsConstituentsAlreadyInAggregate) {
    specialMsgLabel.setText("(* indicates delegate component is already part of aggregate)");
  } else if (bContainsAggregate) {
    specialMsgLabel.setText("(** is aggregate currently being configured)");
  }

  createWideLabel(composite, "Delegate Component Description:");

  delegateComponentDescriptionText = new Text(composite, SWT.MULTI | SWT.WRAP | SWT.V_SCROLL
          | SWT.BORDER);
  delegateComponentDescriptionText.setLayoutData(new GridData(GridData.FILL_BOTH));
  GridData dcgd = new GridData(GridData.FILL_HORIZONTAL);
  dcgd.heightHint = 50;
  delegateComponentDescriptionText.setLayoutData(dcgd);
  delegateComponentDescriptionText.setEditable(false);

  createWideLabel(composite, "Input Types:");

  inputTypesList = new List(composite, SWT.BORDER | SWT.V_SCROLL);
  inputTypesList.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

  createWideLabel(composite, "Output Types:");

  outputTypesList = new List(composite, SWT.BORDER | SWT.V_SCROLL);
  outputTypesList.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

  // autoAddToFlowButton = new Button(composite, SWT.CHECK);
  // autoAddToFlowButton.setText("Add selected delegate components to end of flow");
  // autoAddToFlowButton.setSelection(true);
  // autoAddToFlowButton.setBackground(null);

  importByNameUI = newButton(composite, SWT.RADIO, "Import by Name",
          "Importing by name looks up the name on the classpath and datapath.");
  importByLocationUI = newButton(composite, SWT.RADIO, "Import by Location",
          "Importing by location requires a relative or absolute URL");

  String defaultBy = CDEpropertyPage.getImportByDefault(editor.getProject());
  if (defaultBy.equals("location")) {
    importByNameUI.setSelection(false);
    importByLocationUI.setSelection(true);
  } else {
    importByNameUI.setSelection(true);
    importByLocationUI.setSelection(false);
  }
  return composite;
}
 
Example 19
Source File: CopyTableWizardPage2.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
public void createControl( Composite parent ) {
  shell = parent.getShell();

  // create the composite to hold the widgets
  Composite composite = new Composite( parent, SWT.NONE );
  props.setLook( composite );

  FormLayout compLayout = new FormLayout();
  compLayout.marginHeight = Const.FORM_MARGIN;
  compLayout.marginWidth = Const.FORM_MARGIN;
  composite.setLayout( compLayout );

  // Source list to the left...
  wlListSource = new Label( composite, SWT.NONE );
  wlListSource.setText( BaseMessages.getString( PKG, "CopyTableWizardPage2.Dialog.TableList.Label" ) );
  props.setLook( wlListSource );
  FormData fdlListSource = new FormData();
  fdlListSource.left = new FormAttachment( 0, 0 );
  fdlListSource.top = new FormAttachment( 0, 0 );
  wlListSource.setLayoutData( fdlListSource );

  wListSource = new List( composite, SWT.BORDER | SWT.SINGLE | SWT.V_SCROLL | SWT.H_SCROLL );
  props.setLook( wListSource );
  wListSource.addSelectionListener( new SelectionAdapter() {
    public void widgetSelected( SelectionEvent arg0 ) {
      setPageComplete( canFlipToNextPage() );
    }
  } );

  FormData fdListSource = new FormData();
  fdListSource.left = new FormAttachment( 0, 0 );
  fdListSource.top = new FormAttachment( wlListSource, 0 );
  fdListSource.right = new FormAttachment( 100, 0 );
  fdListSource.bottom = new FormAttachment( 100, 0 );
  wListSource.setLayoutData( fdListSource );

  // Double click adds to destination.
  wListSource.addSelectionListener( new SelectionAdapter() {
    public void widgetDefaultSelected( SelectionEvent e ) {
      if ( canFinish() ) {
        getWizard().performFinish();
        shell.dispose();
      }
    }
  } );

  // set the composite as the control for this page
  setControl( composite );
}
 
Example 20
Source File: SDViewerPage.java    From tracecompass with Eclipse Public License 2.0 4 votes vote down vote up
@Override
protected Control createContents(Composite parent) {
    GridLayout gl = new GridLayout();
    gl.marginHeight = 0;
    gl.marginWidth = 0;
    parent.setLayout(gl);
    Composite page = new Composite(parent, SWT.NONE);
    GridLayout pageLayout = new GridLayout();
    pageLayout.numColumns = 2;
    GridData pageLayoutdata = new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_VERTICAL | GridData.VERTICAL_ALIGN_FILL);
    page.setLayoutData(pageLayoutdata);
    page.setLayout(pageLayout);

    fTooltip = new BooleanFieldEditor(ISDPreferences.PREF_TOOLTIP, Messages.SequenceDiagram_ShowTooltips, page);
    fTooltip.setPreferenceStore(fPreferences.getPreferenceStore());
    fTooltip.load();

    // link font with zoom pref
    fLink = new BooleanFieldEditor(ISDPreferences.PREF_LINK_FONT, Messages.SequenceDiagram_IncreaseFontSizeWhenZooming, page);
    fLink.setPreferenceStore(fPreferences.getPreferenceStore());
    fLink.load();

    fNoExternalTime = new BooleanFieldEditor(ISDPreferences.PREF_EXCLUDE_EXTERNAL_TIME, Messages.SequenceDiagram_ExcludeExternalTime, page);
    fNoExternalTime.setPreferenceStore(fPreferences.getPreferenceStore());
    fNoExternalTime.load();

    // use gradient color pref
    fUseGrad = new BooleanFieldEditor(ISDPreferences.PREF_USE_GRADIENT, Messages.SequenceDiagram_UseGradientColor, page);
    fUseGrad.setPreferenceStore(fPreferences.getPreferenceStore());
    fUseGrad.load();

    Label separator = new Label(page, SWT.SEPARATOR | SWT.HORIZONTAL | SWT.SHADOW_NONE);
    GridData sepData = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL);
    separator.setLayoutData(sepData);

    Composite prefPage = new Composite(page, SWT.NONE);
    GridLayout prefPageLayout = new GridLayout();
    prefPage.setLayoutData(pageLayoutdata);
    prefPageLayout.numColumns = 1;
    prefPage.setLayout(prefPageLayout);

    // swimLane width pref
    fLifelineWidth = new IntegerFieldEditor(ISDPreferences.PREF_LIFELINE_WIDTH, Messages.SequenceDiagram_LifelineWidth, prefPage);
    fLifelineWidth.setPreferenceStore(fPreferences.getPreferenceStore());
    fLifelineWidth.setValidRange(119, 500);
    fLifelineWidth.load();

    // not very nice
    new Label(prefPage, SWT.SEPARATOR | SWT.HORIZONTAL | SWT.SHADOW_NONE);
    new Label(prefPage, SWT.SEPARATOR | SWT.HORIZONTAL | SWT.SHADOW_NONE);

    // Font list pref
    fClassItemList = new List(prefPage, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
    GridData tabItemLayoutdata = new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_VERTICAL | GridData.VERTICAL_ALIGN_FILL);
    fClassItemList.setLayoutData(tabItemLayoutdata);

    String[] fontList2 = SDViewPref.getFontList2();
    for (int i = 0; i < fontList2.length; i++) {
        fClassItemList.add(fontList2[i]);
    }
    fClassItemList.setSelection(0);
    fClassItemList.addSelectionListener(this);
    fButtonArea = new Composite(prefPage, SWT.NONE);
    GridData tabItemLayoutdata2 = new GridData(GridData.HORIZONTAL_ALIGN_FILL/* |GridData.GRAB_HORIZONTAL */| GridData.GRAB_VERTICAL | GridData.VERTICAL_ALIGN_FILL);
    fButtonArea.setLayoutData(tabItemLayoutdata2);
    GridLayout buttonAreaLayout = new GridLayout();
    buttonAreaLayout.numColumns = 1;
    fButtonArea.setLayout(buttonAreaLayout);

    // font selector initialise for the lifeline font pref
    String[] fontList = SDViewPref.getFontList();
    fFont = new FontFieldEditor(fontList[0], "",//$NON-NLS-1$
            Messages.SequenceDiagram_AaBbYyZz, fButtonArea);
    fFont.getPreviewControl().setSize(500, 500);
    fFont.setPreferenceStore(fPreferences.getPreferenceStore());
    fFont.load();

    fBackGroundColor = new ColorFieldEditor(fontList[0] + SDViewPref.BACK_COLOR_POSTFIX, Messages.SequenceDiagram_Background, fButtonArea);
    fBackGroundColor.setPreferenceStore(fPreferences.getPreferenceStore());
    fBackGroundColor.load();

    fLineColor = new ColorFieldEditor(fontList[0] + SDViewPref.FORE_COLOR_POSTFIX, Messages.SequenceDiagram_Lines, fButtonArea);
    fLineColor.setPreferenceStore(fPreferences.getPreferenceStore());
    fLineColor.load();

    fTextColor = new ColorFieldEditor(fontList[0] + SDViewPref.TEXT_COLOR_POSTFIX, Messages.SequenceDiagram_Text, fButtonArea);
    fTextColor.setPreferenceStore(fPreferences.getPreferenceStore());
    fTextColor.load();
    swapPref(true);
    Dialog.applyDialogFont(page);

    return page;
}