Java Code Examples for org.eclipse.swt.SWT#HIDE_SELECTION

The following examples show how to use org.eclipse.swt.SWT#HIDE_SELECTION . 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: IndexTabWrapper.java    From ermasterr with Apache License 2.0 6 votes vote down vote up
private void initTable(final Composite parent) {
    final GridData gridData = new GridData();
    gridData.horizontalSpan = 3;
    gridData.grabExcessHorizontalSpace = true;
    gridData.horizontalAlignment = GridData.FILL;
    gridData.heightHint = 200;

    indexTable = new Table(parent, SWT.BORDER | SWT.HIDE_SELECTION);

    indexTable.setHeaderVisible(true);
    indexTable.setLayoutData(gridData);
    indexTable.setLinesVisible(true);

    CompositeFactory.createTableColumn(indexTable, "label.column.name", -1);
    final TableColumn separatorColumn = CompositeFactory.createTableColumn(indexTable, "", 3);
    separatorColumn.setResizable(false);
}
 
Example 2
Source File: IndexTabWrapper.java    From erflute with Apache License 2.0 6 votes vote down vote up
private void initTable(Composite parent) {
    final GridData gridData = new GridData();
    gridData.horizontalSpan = 3;
    gridData.grabExcessHorizontalSpace = true;
    gridData.horizontalAlignment = GridData.FILL;
    gridData.heightHint = 200;

    this.indexTable = new Table(parent, SWT.BORDER | SWT.HIDE_SELECTION);

    indexTable.setHeaderVisible(true);
    indexTable.setLayoutData(gridData);
    indexTable.setLinesVisible(true);

    CompositeFactory.createTableColumn(indexTable, "label.column.name", ERTableComposite.NAME_WIDTH, SWT.NONE);
    final TableColumn separatorColumn = CompositeFactory.createTableColumn(indexTable, "", 3, SWT.NONE);
    separatorColumn.setResizable(false);
}
 
Example 3
Source File: BufferDialog.java    From e4macs with Eclipse Public License 1.0 6 votes vote down vote up
private Control createBufferTip(Composite parent, IEditorReference ref) {

		Composite result = new Composite(parent, SWT.NO_FOCUS);
		Color bg = parent.getBackground();
		result.setBackground(bg);
		GridLayout gridLayout = new GridLayout();
		gridLayout.numColumns = 1;
		result.setLayout(gridLayout);

		StyledText name = new StyledText(result, SWT.READ_ONLY | SWT.HIDE_SELECTION);
		// italics results in slightly clipped text unless extended
		String text = ref.getTitleToolTip() + ' ';
		name.setText(text);
		name.setBackground(bg);
		name.setCaret(null);
		StyleRange styleIt = new StyleRange(0, text.length(), null, bg);
		styleIt.fontStyle = SWT.ITALIC;
		name.setStyleRange(styleIt);
		
		return result;
	}
 
Example 4
Source File: AbstractVarValViewerHandler.java    From uima-uimaj with Apache License 2.0 6 votes vote down vote up
/**
 * Create the Table.
 *
 * @param parent the parent
 */
protected void createTable(Composite parent) {
  int style = SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION
          | SWT.HIDE_SELECTION;

  table = new Table(parent, style);

  GridData gridData = new GridData(GridData.FILL_BOTH);
  gridData.grabExcessVerticalSpace = true;
  gridData.horizontalSpan = 3;
  gridData.heightHint = 60;
  table.setLayoutData(gridData);

  table.setLinesVisible(true);
  table.setHeaderVisible(true);

  createTableColumns();
}
 
Example 5
Source File: IndexTabWrapper.java    From ermaster-b with Apache License 2.0 6 votes vote down vote up
private void initTable(Composite parent) {
	GridData gridData = new GridData();
	gridData.horizontalSpan = 3;
	gridData.grabExcessHorizontalSpace = true;
	gridData.horizontalAlignment = GridData.FILL;
	gridData.heightHint = 200;

	this.indexTable = new Table(parent, SWT.BORDER | SWT.HIDE_SELECTION);

	this.indexTable.setHeaderVisible(true);
	this.indexTable.setLayoutData(gridData);
	this.indexTable.setLinesVisible(true);

	CompositeFactory.createTableColumn(this.indexTable,
			"label.column.name", ERTableComposite.NAME_WIDTH, SWT.NONE);
	TableColumn separatorColumn = CompositeFactory.createTableColumn(
			this.indexTable, "", 3, SWT.NONE);
	separatorColumn.setResizable(false);
}
 
Example 6
Source File: BrowserEnvironmentWarningDialog.java    From hop with Apache License 2.0 5 votes vote down vote up
private void setWarningText( String message, int maxTextWidth ) {
  description = new Text( shell, SWT.MULTI | SWT.LEFT | SWT.WRAP | SWT.NO_FOCUS | SWT.HIDE_SELECTION );
  description.setText( message );
  description.setEditable( false );
  FormData fdlDesc = new FormData();
  fdlDesc.left = new FormAttachment( warningIcon, margin ); // Text should be right of the icon and at the top
  fdlDesc.top = new FormAttachment( 0, 0 );
  fdlDesc.width = maxTextWidth;
  description.setLayoutData( fdlDesc );
  props.setLook( description );
}
 
Example 7
Source File: CategoryManageDialog.java    From ermasterr with Apache License 2.0 5 votes vote down vote up
private void createNodeGroup(final Composite composite) {
    final Group group = new Group(composite, SWT.NONE);
    group.setLayout(new GridLayout());
    group.setText(ResourceString.getResourceString("label.category.object.message"));

    final GridData gridData = new GridData();
    gridData.heightHint = GROUP_HEIGHT;
    group.setLayoutData(gridData);

    CompositeFactory.fillLine(group, 5);

    final GridData tableGridData = new GridData();
    tableGridData.grabExcessVerticalSpace = true;
    tableGridData.verticalAlignment = GridData.FILL;

    nodeTable = new Table(group, SWT.BORDER | SWT.HIDE_SELECTION);
    nodeTable.setHeaderVisible(true);
    nodeTable.setLayoutData(tableGridData);
    nodeTable.setLinesVisible(true);

    final TableColumn tableColumn2 = new TableColumn(nodeTable, SWT.NONE);
    tableColumn2.setWidth(30);
    tableColumn2.setResizable(false);
    tableColumn2.setText("");
    final TableColumn tableColumn3 = new TableColumn(nodeTable, SWT.NONE);
    tableColumn3.setWidth(80);
    tableColumn3.setResizable(false);
    tableColumn3.setText(ResourceString.getResourceString("label.object.type"));
    final TableColumn tableColumn4 = new TableColumn(nodeTable, SWT.NONE);
    tableColumn4.setWidth(200);
    tableColumn4.setResizable(false);
    tableColumn4.setText(ResourceString.getResourceString("label.object.name"));
}
 
Example 8
Source File: ExternalizeWizardPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
private Control createTable(Composite parent) {
	Composite c= new Composite(parent, SWT.NONE);
	GridLayout gl= new GridLayout();
	gl.numColumns= 2;
	gl.marginWidth= 0;
	gl.marginHeight= 0;
	c.setLayout(gl);


	fTable= new Table(c, SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.FULL_SELECTION | SWT.HIDE_SELECTION | SWT.BORDER);
	fTable.setFont(parent.getFont());

	GridData tableGD= new GridData(GridData.FILL_BOTH);
	tableGD.heightHint= SWTUtil.getTableHeightHint(fTable, ROW_COUNT);
	//tableGD.widthHint= 40;
	fTable.setLayoutData(tableGD);

	fTable.setLinesVisible(true);

	TableLayout layout= new TableLayout();
	fTable.setLayout(layout);
	fTable.setHeaderVisible(true);

	ColumnLayoutData[] columnLayoutData= new ColumnLayoutData[SIZE];
	columnLayoutData[STATE_PROP]= new ColumnPixelData(18, false, true);
	columnLayoutData[KEY_PROP]= new ColumnWeightData(40, true);
	columnLayoutData[VAL_PROP]= new ColumnWeightData(40, true);

	for (int i= 0; i < fgTitles.length; i++) {
		TableColumn tc= new TableColumn(fTable, SWT.NONE, i);
		tc.setText(fgTitles[i]);
		layout.addColumnData(columnLayoutData[i]);
		tc.setResizable(columnLayoutData[i].resizable);
	}

	createButtonComposite(c);
	return c;
}
 
Example 9
Source File: MenuBar.java    From olca-app with Mozilla Public License 2.0 5 votes vote down vote up
private Button createButton(Icon icon, String tooltipText) {
	Button button = new Button(this, SWT.FLAT | SWT.NO_FOCUS
			| SWT.HIDE_SELECTION);
	button.setImage(icon.get());
	button.setToolTipText(tooltipText);
	button.setData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));
	return button;
}
 
Example 10
Source File: JsonTreeViewer.java    From olca-app with Mozilla Public License 2.0 5 votes vote down vote up
@Override
protected TreeViewer createViewer(Composite parent) {
	TreeViewer viewer = new TreeViewer(parent, SWT.MULTI | SWT.NO_FOCUS | SWT.HIDE_SELECTION | SWT.BORDER);
	viewer.setContentProvider(new ContentProvider());
	Tree tree = viewer.getTree();
	if (viewerParameters[0] == Site.LOCAL)
		tree.getVerticalBar().setVisible(false);
	UI.gridData(tree, true, true);
	viewer.addDoubleClickListener((e) -> onDoubleClick(e));
	return viewer;
}
 
Example 11
Source File: BrowserEnvironmentWarningDialog.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
private void setWarningText( String message, int maxTextWidth ) {
  description = new Text( shell, SWT.MULTI | SWT.LEFT | SWT.WRAP | SWT.NO_FOCUS | SWT.HIDE_SELECTION );
  description.setText( message );
  description.setEditable( false );
  FormData fdlDesc = new FormData();
  fdlDesc.left = new FormAttachment( warningIcon, margin ); // Text should be right of the icon and at the top
  fdlDesc.top = new FormAttachment( 0, 0 );
  fdlDesc.width = maxTextWidth;
  description.setLayoutData( fdlDesc );
  props.setLook( description );
}
 
Example 12
Source File: RoundedToolbarSnippet.java    From nebula with Eclipse Public License 2.0 4 votes vote down vote up
private static RoundedToolbar createRadioButtons(final Shell shell, final boolean verticalAlignment, final boolean drawRadio) {
	final RoundedToolbar toolBar = new RoundedToolbar(shell, drawRadio ? SWT.NONE : SWT.HIDE_SELECTION);
	toolBar.setCornerRadius(8);
	toolBar.setBackground(grey1);

	final RoundedToolItem mailItem = new RoundedToolItem(toolBar, SWT.RADIO);
	mailItem.setSelectionImage(emailw);
	mailItem.setImage(emailb);
	mailItem.setWidth(drawRadio ? 50 : 32);
	mailItem.addListener(SWT.Selection, e -> {
		System.out.println("radio/Button 1");
	});
	if (verticalAlignment) {
		mailItem.setVerticalAlignment(SWT.TOP);
	}

	final RoundedToolItem mailItemWithText = new RoundedToolItem(toolBar, SWT.RADIO);
	mailItemWithText.setTextColorSelected(grey2);
	mailItemWithText.setText("Mails");
	mailItemWithText.setSelectionImage(emailw);
	mailItemWithText.setImage(emailb);
	mailItemWithText.setWidth(drawRadio ? 80 : 65);
	mailItemWithText.addListener(SWT.Selection, e -> {
		System.out.println("radio/Button 2");
	});
	if (verticalAlignment) {
		mailItemWithText.setVerticalAlignment(SWT.CENTER);
	}

	final RoundedToolItem itemJustText = new RoundedToolItem(toolBar, SWT.RADIO);
	itemJustText.setTextColorSelected(grey2);
	itemJustText.setText("Just text");
	itemJustText.setWidth(100);
	itemJustText.setAlignment(SWT.RIGHT);
	itemJustText.addListener(SWT.Selection, e -> {
		System.out.println("radio/Button 3");
	});

	if (verticalAlignment) {
		itemJustText.setVerticalAlignment(SWT.BOTTOM);
	}
	return toolBar;
}
 
Example 13
Source File: SpinnerTable.java    From birt with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * Constructs a new instance of this class given its parent , a style and a
 * calendar
 * 
 * @param composite
 * @param style
 * @param calendar
 */
public SpinnerTable( Composite composite, int style, Calendar calendar )
{
	super( composite, style );
	table = new TimeTable( this, SWT.HIDE_SELECTION | style | SWT.BORDER );

	createColumn( table );

	cursor = new TimeTableCursor( table, SWT.NONE );
	cursor.setBackground( Display.getCurrent( )
			.getSystemColor( SWT.COLOR_BLUE ) );
	cursor.setForeground( Display.getCurrent( )
			.getSystemColor( SWT.COLOR_WHITE ) );
	cursor.addSelectionListener( new SelectionAdapter( ) {

		// when the TableEditor is over a cell, select the corresponding
		// row in
		// the table
		public void widgetSelected( SelectionEvent e )
		{

			TableItem row = cursor.getRow( );
			String value = row.getText( cursor.getColumn( ) );
			int strValue = 0;
			try
			{
				strValue = Integer.parseInt( value );
			}
			catch ( Exception ee )
			{

				setOriValue( );
				return;
			}

			int oldValue = cale.get( Calendar.DAY_OF_MONTH );
			cale.set( Calendar.DAY_OF_MONTH, strValue );

			//source I think is a Object
			firePropertyListener( new PropertyChangeEvent( new Object( ),
					"daychange", //$NON-NLS-1$
					Integer.valueOf( oldValue ),
					Integer.valueOf( strValue ) ) );

		}
	} );

	createItems( );
	setCalendar( calendar );

}
 
Example 14
Source File: RoundedToolItem.java    From nebula with Eclipse Public License 2.0 3 votes vote down vote up
/**
 * Constructs a new instance of this class given its parent (which must be a
 * <code>ToolBar</code>) and a style value describing its behavior and
 * appearance. The item is added to the end of the items maintained by its
 * parent.
 * <p>
 * The style value is either one of the style constants defined in class
 * <code>SWT</code> which is applicable to instances of this class, or must
 * be built by <em>bitwise OR</em>'ing together (that is, using the
 * <code>int</code> "|" operator) two or more of those <code>SWT</code>
 * style constants. The class description lists the style constants that are
 * applicable to the class. Style bits are also inherited from superclasses.
 * </p>
 *
 * @param parent a composite control which will be the parent of the new
 *            instance (cannot be null)
 * @param style the style of control to construct
 *
 * @exception IllegalArgumentException
 *                <ul>
 *                <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
 *                </ul>
 * @exception SWTException
 *                <ul>
 *                <li>ERROR_THREAD_INVALID_ACCESS - if not called from the
 *                thread that created the parent</li>
 *                <li>ERROR_INVALID_SUBCLASS - if this class is not an
 *                allowed subclass</li>
 *                </ul>
 *
 * @see Widget#getStyle
 */
public RoundedToolItem(final RoundedToolbar parent, final int style) {
	super(parent, checkStyle(style));
	parent.addItem(this);
	parentToolbar = parent;
	textColor = parent.getDisplay().getSystemColor(SWT.COLOR_BLACK);
	textColorSelected = parent.getDisplay().getSystemColor(SWT.COLOR_WHITE);
	enabled = true;
	alignment = SWT.CENTER;
	verticalAlignment = SWT.CENTER;
	selectionListeners = new CopyOnWriteArrayList<SelectionListener>();
	width = -1;
	height = -1;
	hideSelection = (parent.getStyle() & SWT.HIDE_SELECTION) == SWT.HIDE_SELECTION;
}