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

The following examples show how to use org.eclipse.swt.SWT#NONE . 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: DetailComponentImpl.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
private void createURLImage ( final Composite parent, final URLImageComponent component, final Map<String, String> properties )
{
    final DataItemDescriptor descriptor = DataItemDescriptor.create ( resolve ( component.getDescriptor (), properties ) );

    final VisibilityProvider provider = this.visibleFactory.createProvider ( component.getVisibility () );

    final ComponentVisibility visibility = new ComponentVisibility ( provider, new TrackingVisibleComponent () {

        @Override
        public void create ()
        {
            final URLImageLabel image = new URLImageLabel ( parent, SWT.NONE, descriptor, component );

            setSummaryProvider ( image.getSummaryProvider () );

            trackControl ( image );
            trackItem ( descriptor );
        }

    } );

    addComponent ( visibility );
}
 
Example 2
Source File: WebSearchPreferencePage.java    From translationstudio8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * (non-Javadoc)
 * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
 */
@Override
protected Control createContents(Composite parent) {

	Composite tparent = new Composite(parent, SWT.NONE);
	tparent.setLayout(new GridLayout(1, false));
	tparent.setLayoutData(new GridData(GridData.FILL_BOTH));

	Group group = new Group(tparent, SWT.NONE);
	group.setText(Messages.getString("Websearch.WebSearcPreferencePage.urlSet"));
	group.setLayout(new GridLayout(1, false));
	group.setLayoutData(new GridData(GridData.FILL_BOTH));

	// Composite composite = new Composite(group, SWT.NONE);
	createTitleArea(group);

	Composite urlArea = new Composite(group, SWT.NONE);
	GridLayout urlArea_layout = new GridLayout(2, false);
	urlArea.setLayout(urlArea_layout);
	urlArea.setLayoutData(new GridData(GridData.FILL_BOTH));
	createTableArea(urlArea);
	createTableCmdArea(urlArea);
	installListeners();
	return group;
}
 
Example 3
Source File: GroupManageDialog.java    From ermaster-b with Apache License 2.0 6 votes vote down vote up
/**
 * This method initializes group
 * 
 */
private void createGroup(Composite parent) {
	GridLayout gridLayout = new GridLayout();
	gridLayout.numColumns = 3;

	GridData gridData1 = new GridData();
	gridData1.horizontalSpan = 3;

	GridData gridData2 = new GridData();
	gridData2.widthHint = 200;
	gridData2.horizontalSpan = 3;
	gridData2.heightHint = GROUP_LIST_HEIGHT;

	Group group = new Group(parent, SWT.NONE);
	group.setText(ResourceString.getResourceString("label.group.list"));
	group.setLayoutData(gridData1);
	group.setLayout(gridLayout);

	this.groupList = new org.eclipse.swt.widgets.List(group, SWT.BORDER
			| SWT.V_SCROLL);
	this.groupList.setLayoutData(gridData2);

	this.initGroupList();
}
 
Example 4
Source File: PeerTableViewer.java    From offspring with MIT License 6 votes vote down vote up
private void createColumns() {
  for (int id : PeerTable.getColumns(peerType)) {
    TableViewerColumn viewerColumn = new TableViewerColumn(this, SWT.NONE);
    TableColumn column = viewerColumn.getColumn();

    viewerColumn
        .setLabelProvider(PeerTable.createLabelProvider(id, peerType));
    column.addSelectionListener(getSelectionAdapter(column, id));

    column.setText(PeerTable.getColumnLabel(id));
    column.setAlignment(PeerTable.getColumnAlignment(id));

    column.setResizable(PeerTable.getColumnResizable(id));
    column.setWidth(PeerTable.getColumnWidth(id));
  }
}
 
Example 5
Source File: TimeGraphFindDialog.java    From tracecompass with Eclipse Public License 2.0 6 votes vote down vote up
/**
 * Creates the options configuration section of the find dialog.
 *
 * @param parent
 *            the parent composite
 * @return the options configuration section
 */
private Composite createConfigPanel(Composite parent) {

    Composite panel = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    panel.setLayout(layout);

    Composite directionGroup = createDirectionGroup(panel);
    setGridData(directionGroup, SWT.FILL, true, SWT.FILL, false);

    Composite optionsGroup = createOptionsGroup(panel);
    setGridData(optionsGroup, SWT.FILL, true, SWT.FILL, true);
    ((GridData) optionsGroup.getLayoutData()).horizontalSpan = 2;

    return panel;
}
 
Example 6
Source File: MessageArea.java    From nebula with Eclipse Public License 2.0 6 votes vote down vote up
/**
 * Create the title
 *
 * @param hasIcon if <code>true</code> an icon is displayed
 */
private void createTitle(final boolean hasIcon) {
	final Label label = new Label(composite, SWT.NONE);
	label.setText(title);
	label.setFont(getBiggerFont());
	label.setForeground(getTitleColor());
	final GridData gd = new GridData(GridData.BEGINNING, GridData.BEGINNING, false, false, 1, 1);

	if (hasIcon) {
		gd.horizontalIndent = INDENT_NO_ICON;
	} else {
		gd.horizontalIndent = DEFAULT_MARGIN;
		gd.verticalIndent = DEFAULT_MARGIN;
	}

	label.setLayoutData(gd);
}
 
Example 7
Source File: HierarchyWizardPageOrder.java    From arx with Apache License 2.0 5 votes vote down vote up
/**
 * Create the grouping-part of the page.
 *
 * @param parent
 */
private void createGroups(Composite parent){
    Group composite = new Group(parent, SWT.NONE);
    composite.setText(Resources.getMessage("HierarchyWizardPageOrder.17")); //$NON-NLS-1$
    composite.setLayout(SWTUtil.createGridLayout(1, false));
    composite.setLayoutData(SWTUtil.createFillGridData());
    editor =  new HierarchyWizardEditor<T>(composite, (HierarchyWizardModelGrouping<T>) model);
    editor.setLayoutData(SWTUtil.createFillGridData());
}
 
Example 8
Source File: AggregateEditorComposite.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * 
 * @param parent
 * @param sd
 * @param context
 * @param enabled
 * @deprecated
 */
public AggregateEditorComposite( Composite parent, SeriesDefinition sd,
		ChartWizardContext context, boolean enabled )
{
	super( parent, SWT.NONE );
	setSeriesDefinition( sd );
	fChartContext = context;
	fEnabled = enabled;
	placeComponents( );
}
 
Example 9
Source File: RuntimeLibraryContainerWizardPage.java    From txtUML with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void createControl(Composite parent) {
	Composite composite = new Composite(parent, SWT.NONE);
	composite.setLayout(new FillLayout());
	Label label = new Label(composite, SWT.NONE);
	String aboutText = NLS
			.bind(Messages.RuntimeLibraryContainerWizardPage_classpathLibraryText,
					containedBundles());
	label.setText(aboutText);
	setControl(composite);
}
 
Example 10
Source File: TranslationWizardPage.java    From tmxeditor8 with GNU General Public License v2.0 5 votes vote down vote up
public void createControl(Composite parent) {
	Composite composite = new Composite(parent, SWT.NONE);
	Label label = new Label(composite, SWT.NONE);
	label.setText("Test:");
	new Text(composite, SWT.BORDER);
	GridLayoutFactory.swtDefaults().numColumns(2).generateLayout(composite);
	setControl(composite);
}
 
Example 11
Source File: JavaCamelJobScriptsExportWSWizardPage.java    From tesb-studio-se with Apache License 2.0 5 votes vote down vote up
@Override
protected void createDestinationGroup(Composite parent) {
    Font font = parent.getFont();
    // destination specification group
    Composite destinationSelectionGroup = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.numColumns = 3;
    destinationSelectionGroup.setLayout(layout);
    destinationSelectionGroup.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL));
    destinationSelectionGroup.setFont(font);

    destinationLabel = new Label(destinationSelectionGroup, SWT.NONE);
    destinationLabel.setText(getDestinationLabel());
    destinationLabel.setFont(font);

    // destination name entry field
    destinationNameField = new Combo(destinationSelectionGroup, SWT.SINGLE | SWT.BORDER);
    destinationNameField.addListener(SWT.Modify, this);
    destinationNameField.addListener(SWT.Selection, this);
    GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
    data.widthHint = SIZING_TEXT_FIELD_WIDTH;
    destinationNameField.setLayoutData(data);
    destinationNameField.setFont(font);
    BidiUtils.applyBidiProcessing(destinationNameField, "file"); //$NON-NLS-1$

    // destination browse button
    destinationBrowseButton = new Button(destinationSelectionGroup, SWT.PUSH);
    destinationBrowseButton.setText(DataTransferMessages.DataTransfer_browse);
    destinationBrowseButton.addListener(SWT.Selection, this);
    destinationBrowseButton.setFont(font);
    setButtonLayoutData(destinationBrowseButton);

    new Label(parent, SWT.NONE); // vertical spacer
}
 
Example 12
Source File: TopLevelFolderPropertyPage.java    From gama with GNU General Public License v3.0 5 votes vote down vote up
private void addFirstSection(final Composite parent) {
	final Composite composite = createDefaultComposite(parent);

	// Label for path field
	final Label pathLabel = new Label(composite, SWT.NONE);
	pathLabel.setText("Virtual Folder ");

	// Path text field
	final Text pathValueText = new Text(composite, SWT.WRAP | SWT.READ_ONLY);
	pathValueText.setText(getFolder().getName());
}
 
Example 13
Source File: OperatorWithControlPanel.java    From Rel with Apache License 2.0 5 votes vote down vote up
@Override
protected Control obtainControlPanel(Visualiser parent) {
	Composite controlPanel = new Composite(parent, SWT.NONE);
	controlPanel.setLayout(new FillLayout());
	operatorLabel = new StyledText(controlPanel, SWT.MULTI);
	operatorLabel.setEditable(false);
	operatorLabel.setBackground(BackgroundColor);
	if (!getModel().getRev().isReadOnly())
		operatorLabel.addListener(SWT.MouseUp, e -> {
			if (operatorLabel.getBounds().contains(e.x, e.y))
				openDetails();
		});
	return controlPanel;
}
 
Example 14
Source File: SplitterPropertiesEditionPartImpl.java    From eip-designer with Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.parts.ISWTPropertiesEditionPart#
 * 			createFigure(org.eclipse.swt.widgets.Composite)
 * 
 */
public Composite createFigure(final Composite parent) {
	view = new Composite(parent, SWT.NONE);
	GridLayout layout = new GridLayout();
	layout.numColumns = 3;
	view.setLayout(layout);
	createControls(view);
	return view;
}
 
Example 15
Source File: BoxSettingsTab.java    From gama with GNU General Public License v3.0 4 votes vote down vote up
protected Button newButton(final Composite c, final String name, final SelectionAdapter selectionAdapter) {
	final Button b = new Button(c, SWT.NONE);
	b.setText(name);
	b.addSelectionListener(selectionAdapter);
	return b;
}
 
Example 16
Source File: StepsMetricsDialog.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
  Table table = wFields.table;
  if ( input.getStepName().length > 0 ) {
    table.removeAll();
  }
  for ( int i = 0; i < input.getStepName().length; i++ ) {
    TableItem ti = new TableItem( table, SWT.NONE );
    ti.setText( 0, "" + ( i + 1 ) );
    if ( input.getStepName()[i] != null ) {
      ti.setText( 1, input.getStepName()[i] );
      ti.setText( 2, String.valueOf( Const.toInt( input.getStepCopyNr()[i], 0 ) ) );
      ti.setText( 3, input.getRequiredStepsDesc( input.getStepRequired()[i] ) );
    }
  }

  wFields.removeEmptyRows();
  wFields.setRowNums();
  wFields.optWidth( true );

  if ( input.getStepNameFieldName() != null ) {
    wStepnameField.setText( input.getStepNameFieldName() );
  }
  if ( input.getStepIdFieldName() != null ) {
    wStepidField.setText( input.getStepIdFieldName() );
  }
  if ( input.getStepLinesInputFieldName() != null ) {
    wLinesinputField.setText( input.getStepLinesInputFieldName() );
  }
  if ( input.getStepLinesOutputFieldName() != null ) {
    wLinesoutputField.setText( input.getStepLinesOutputFieldName() );
  }
  if ( input.getStepLinesReadFieldName() != null ) {
    wLinesreadField.setText( input.getStepLinesReadFieldName() );
  }
  if ( input.getStepLinesWrittenFieldName() != null ) {
    wLineswrittenField.setText( input.getStepLinesWrittenFieldName() );
  }
  if ( input.getStepLinesUpdatedFieldName() != null ) {
    wLinesupdatedField.setText( input.getStepLinesUpdatedFieldName() );
  }
  if ( input.getStepLinesErrorsFieldName() != null ) {
    wLineserrorsField.setText( input.getStepLinesErrorsFieldName() );
  }
  if ( input.getStepSecondsFieldName() != null ) {
    wSecondsField.setText( input.getStepSecondsFieldName() );
  }

  wStepname.selectAll();
  wStepname.setFocus();
}
 
Example 17
Source File: EigenleistungDetailDisplay.java    From elexis-3-core with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * @wbp.parser.entryPoint
 */
@Override
public Composite createDisplay(Composite parent, IViewSite site){
	Composite ret = new Composite(parent, SWT.None);
	ret.setLayout(new GridLayout(2, false));
	
	Label lblCode = new Label(ret, SWT.NONE);
	lblCode.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
	lblCode.setText("Kürzel (Code)");
	
	textCode = new Text(ret, SWT.BORDER);
	textCode.setData("TEST_COMP_NAME", "EigenleistungDetailCode_txt"); //$NON-NLS-1$
	textCode.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
	textCode.setTextLimit(20);
	textCode.setEditable(false);
	
	Label lblBezeichnung = new Label(ret, SWT.NONE);
	lblBezeichnung.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
	lblBezeichnung.setText("Bezeichnung");
	
	textBezeichnung = new Text(ret, SWT.BORDER | SWT.MULTI);
	textBezeichnung.setData("TEST_COMP_NAME", "EigenleistungDetailName_txt"); //$NON-NLS-1$
	textBezeichnung.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
	textBezeichnung.setTextLimit(80);
	textBezeichnung.setEditable(false);
	
	Label lblEKP = new Label(ret, SWT.NONE);
	lblEKP.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
	lblEKP.setText("Einkaufspreis (Rp.)");
	
	textEKP = new Text(ret, SWT.BORDER);
	textEKP.setData("TEST_COMP_NAME", "EigenleistungDetailEKP_txt"); //$NON-NLS-1$
	textEKP.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
	textEKP.setTextLimit(6);
	textEKP.setEditable(false);
	
	Label lblVKP = new Label(ret, SWT.NONE);
	lblVKP.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
	lblVKP.setText("Verkaufspreis (Rp.)");
	
	textVKP = new Text(ret, SWT.BORDER);
	textVKP.setData("TEST_COMP_NAME", "EigenleistungDetailVKP_txt"); //$NON-NLS-1$
	textVKP.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
	textVKP.setTextLimit(6);
	textVKP.setEditable(false);
	
	Label lblZeit = new Label(ret, SWT.NONE);
	lblZeit.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
	lblZeit.setText("Zeitbedarf");
	
	textZeit = new Text(ret, SWT.BORDER);
	textZeit.setData("TEST_COMP_NAME", "EigenleistungDetailZeit_txt"); //$NON-NLS-1$
	textZeit.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
	textZeit.setTextLimit(4);
	textZeit.setEditable(false);
	return null;
}
 
Example 18
Source File: GridItem_Test.java    From nebula with Eclipse Public License 2.0 4 votes vote down vote up
@Test
public void testGetGrayed() {
  GridItem item = new GridItem( grid, SWT.NONE );
  item.setGrayed( true );
  assertTrue( item.getGrayed() );
}
 
Example 19
Source File: TextVarWarning.java    From hop with Apache License 2.0 4 votes vote down vote up
public TextVarWarning( IVariables variables, Composite composite, int flags ) {
  super( composite, SWT.NONE );

  warningInterfaces = new ArrayList<IWarning>();

  FormLayout formLayout = new FormLayout();
  formLayout.marginWidth = 0;
  formLayout.marginHeight = 0;
  formLayout.marginTop = 0;
  formLayout.marginBottom = 0;

  this.setLayout( formLayout );

  // add a text field on it...
  wText = new TextVar( variables, this, flags );

  warningControlDecoration = new ControlDecoration( wText, SWT.CENTER | SWT.RIGHT );
  Image warningImage = GuiResource.getInstance().getImageWarning();
  warningControlDecoration.setImage( warningImage );
  warningControlDecoration.setDescriptionText( BaseMessages.getString( PKG, "TextVar.tooltip.FieldIsInUse" ) );
  warningControlDecoration.hide();

  // If something has changed, check the warning interfaces
  //
  wText.addModifyListener( new ModifyListener() {
    public void modifyText( ModifyEvent arg0 ) {

      // Verify all the warning interfaces.
      // Show the first that has a warning to show...
      //
      boolean foundOne = false;
      for ( IWarning warningInterface : warningInterfaces ) {
        IWarningMessage warningSituation =
          warningInterface.getWarningSituation( wText.getText(), wText, this );
        if ( warningSituation.isWarning() ) {
          foundOne = true;
          warningControlDecoration.show();
          warningControlDecoration.setDescriptionText( warningSituation.getWarningMessage() );
          break;
        }
      }
      if ( !foundOne ) {
        warningControlDecoration.hide();
      }
    }
  } );

  FormData fdText = new FormData();
  fdText.top = new FormAttachment( 0, 0 );
  fdText.left = new FormAttachment( 0, 0 );
  fdText.right = new FormAttachment( 100, -warningImage.getBounds().width );
  wText.setLayoutData( fdText );
}
 
Example 20
Source File: ExportTmxDialog.java    From translationstudio8 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * 设置TableViewer 列属性
 * @param viewer
 * @param title
 *            列标题
 * @param bound
 *            列宽
 * @param colNumber
 *            列序号
 * @return {@link TableViewerColumn};
 */
private TableViewerColumn createTableViewerColumn(TableViewer viewer, String title, int bound, final int colNumber) {
	final TableViewerColumn viewerColumn = new TableViewerColumn(viewer, SWT.NONE | SWT.Resize);
	final TableColumn column = viewerColumn.getColumn();
	column.setText(title);
	column.setWidth(bound);
	column.setResizable(true);
	column.setMoveable(true);
	return viewerColumn;
}