org.eclipse.swt.widgets.Text#setVisible ( )源码实例Demo

下面列出了org.eclipse.swt.widgets.Text#setVisible ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

@Override
public void createControl(UI_POSITION position, Composite parent) {
  // We add controls only to the BOTTOM position.
  if (position == UI_POSITION.BOTTOM) {
    portLabel = new Label(parent, SWT.NONE);
    portLabel.setVisible(false);
    portLabel.setText(Messages.getString("NEW_SERVER_DIALOG_PORT"));

    portText = new Text(parent, SWT.SINGLE | SWT.BORDER);
    portText.setVisible(false);
    portText.setText(String.valueOf(LocalAppEngineServerBehaviour.DEFAULT_SERVER_PORT));
    portText.addVerifyListener(new PortChangeMonitor());
    portText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    FieldDecorationRegistry registry = FieldDecorationRegistry.getDefault();
    Image errorImage = registry.getFieldDecoration(FieldDecorationRegistry.DEC_ERROR).getImage();

    portDecoration = new ControlDecoration(portText, SWT.LEFT | SWT.TOP);
    portDecoration.setDescriptionText(Messages.getString("NEW_SERVER_DIALOG_INVALID_PORT_VALUE"));
    portDecoration.setImage(errorImage);
    portDecoration.hide();
  }
}
 
源代码2 项目: Pydev   文件: CustomStringFieldEditor.java
public void setVisible(boolean visible, Composite parent) {
    Label labelControl = getLabelControl(parent);
    Text textControl = getTextControl(parent);
    labelControl.setVisible(visible);
    textControl.setVisible(visible);

    Object layoutData = labelControl.getLayoutData();
    if (layoutData instanceof GridData) {
        ((GridData) layoutData).exclude = !visible;
    }
    layoutData = textControl.getLayoutData();
    if (layoutData instanceof GridData) {
        ((GridData) layoutData).exclude = !visible;
    }

}
 
源代码3 项目: CogniCrypt   文件: CompositeForCodeTab.java
public CompositeForCodeTab(final Composite parent, final int style, final Answer answer) {
	super(parent, style);

	// Non-editable text box containing answer value
	final Text txtBoxAnswers = new Text(this, SWT.BORDER);
	txtBoxAnswers.setBounds(5, 5, 210, 25);
	txtBoxAnswers.setEditable(false);
	txtBoxAnswers.setText(answer.getValue());

	// Code dependency text field
	final Text txtValue = new Text(this, SWT.BORDER);
	txtValue.setBounds(220, 5, 200, 25);
	txtValue.setVisible(true);

	final CodeDependency codeDependency = new CodeDependency();

	if (answer.getCodeDependencies() != null) {
		for (final CodeDependency cd : answer.getCodeDependencies()) {
			if (cd.getValue() != null) {
				txtValue.setText(cd.getValue());
				codeDependency.setValue(txtValue.getText());
			}
		}
	}

	txtValue.addFocusListener(new FocusAdapter() {

		@Override
		public void focusLost(final FocusEvent e) {
			codeDependency.setValue(txtValue.getText());
		}
	});

	final ArrayList<CodeDependency> codeDependencies = new ArrayList<CodeDependency>();
	codeDependencies.add(codeDependency);
	answer.setCodeDependencies(codeDependencies);

}
 
源代码4 项目: ermasterr   文件: DirectTestDataTabWrapper.java
@Override
public void initComposite() {
    final Text dummy = CompositeFactory.createNumText(dialog, this, "", 50);
    dummy.setVisible(false);

    createEditTable(this);
}
 
源代码5 项目: Rel   文件: Summarize.java
private void setRowVisibility(int index, Text expression1, Text expression2) {
	expression1.setVisible(aggregateOperators[index].getParameterCount() > 0);
	if (!expression1.getVisible())
		expression1.setText("");
	expression2.setVisible(aggregateOperators[index].getParameterCount() > 1);
	if (!expression2.getVisible())
		expression2.setText("");
}
 
源代码6 项目: ermaster-b   文件: DirectTestDataTabWrapper.java
@Override
public void initComposite() {
	GridLayout layout = new GridLayout();
	layout.numColumns = 2;
	this.setLayout(layout);

	Text dummy = CompositeFactory.createNumText(dialog, this, "", 50);
	dummy.setVisible(false);

	this.createEditTable(this);
}
 
源代码7 项目: APICloud-Studio   文件: AddFeatureDialog.java
/**
 * Create contents of the dialog.
 * @param parent
 */
@Override
protected Control createDialogArea(Composite parent) {
	Composite container = (Composite) super.createDialogArea(parent);
	container.setLayout(new GridLayout(1, false));
	tabFolder = new TabFolder(container, SWT.NONE);
	tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
	
	TabItem ui_LayoutItem = new TabItem(tabFolder, SWT.NONE);
	ui_LayoutItem.setText(Messages.AddFeatureDialog_UI);
	TableViewer UIViewer = createTable(tabFolder, ui_LayoutItem);
	UIViewer.setInput(getFeatureByType(Messages.AddFeatureDialog_THREE));
	
	TabItem navigationMenuItem = new TabItem(tabFolder, SWT.NONE);
	navigationMenuItem.setText(Messages.AddFeatureDialog_VIDEO);
	TableViewer videoViewer = createTable(tabFolder, navigationMenuItem);
	videoViewer.setInput(getFeatureByType(Messages.AddFeatureDialog_FOUR));
	
	TabItem extendedItem = new TabItem(tabFolder, SWT.NONE);
	extendedItem.setText(Messages.AddFeatureDialog_3RD);
	TableViewer _3rdItemViewer = createTable(tabFolder, extendedItem);
	_3rdItemViewer.setInput(getFeatureByType(Messages.AddFeatureDialog_FIVE));
	
	TabItem open_sdk_Item = new TabItem(tabFolder, SWT.NONE);
	open_sdk_Item.setText(Messages.AddFeatureDialog_CUSTOM);
	TableViewer customViewer = createTable(tabFolder, open_sdk_Item);
	customViewer.setInput(getFeatureByType(Messages.AddFeatureDialog_EIGHT));
	
	TabItem deviceAccessItem = new TabItem(tabFolder, SWT.NONE);
	deviceAccessItem.setText(Messages.AddFeatureDialog_INTERACTION);
	TableViewer InteractionViewer = createTable(tabFolder, deviceAccessItem);
	InteractionViewer.setInput(getFeatureByType(Messages.AddFeatureDialog_TWO));
	
	TabItem cloud_ServerItem = new TabItem(tabFolder, SWT.NONE);
	cloud_ServerItem.setText(Messages.AddFeatureDialog_CLOUDSERVER);
	TableViewer cloud_ServerViewer = createTable(tabFolder, cloud_ServerItem);
	cloud_ServerViewer.setInput(getFeatureByType(Messages.AddFeatureDialog_NINE));
	 
	Composite composite = new Composite(container, SWT.NONE);
	composite.setLayout(new GridLayout(4, false));
	composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
	
	lblParamkey = new Label(composite, SWT.NONE);
	lblParamkey.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
	lblParamkey.setText("       urlScheme");
	lblParamkey.setVisible(false);
	
	text_urlScheme = new Text(composite, SWT.BORDER);
	text_urlScheme.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
	text_urlScheme.setVisible(false);
	
	lblParamvalue = new Label(composite, SWT.NONE);
	lblParamvalue.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
	lblParamvalue.setText("     apiKey");
	lblParamvalue.setVisible(false);
	
	text_apiKey = new Text(composite, SWT.BORDER);
	text_apiKey.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
	text_apiKey.setVisible(false);
	return container;
}
 
源代码8 项目: pentaho-kettle   文件: JobHistoryDelegate.java
public JobHistoryLogTab( CTabFolder tabFolder, LogTableInterface logTable ) {
  super( tabFolder, SWT.NONE );
  setLogTable( logTable );

  setText( logTable.getLogTableType() );

  Composite logTableComposite = new Composite( tabFolder, SWT.NONE );
  logTableComposite.setLayout( new FormLayout() );
  spoon.props.setLook( logTableComposite );

  setControl( logTableComposite );

  SashForm sash = new SashForm( logTableComposite, SWT.VERTICAL );
  sash.setLayout( new FillLayout() );
  FormData fdSash = new FormData();
  fdSash.left = new FormAttachment( 0, 0 ); // First one in the left top corner
  fdSash.top = new FormAttachment( 0, 0 );
  fdSash.right = new FormAttachment( 100, 0 );
  fdSash.bottom = new FormAttachment( 100, 0 );
  sash.setLayoutData( fdSash );

  logDisplayTableView = createJobLogTableView( sash );

  if ( logTable.getLogField() != null ) {
    logDisplayText = new Text( sash, SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.READ_ONLY );
    spoon.props.setLook( logDisplayText );
    logDisplayText.setVisible( true );

    FormData fdText = new FormData();
    fdText.left = new FormAttachment( 0, 0 );
    fdText.top = new FormAttachment( 0, 0 );
    fdText.right = new FormAttachment( 100, 0 );
    fdText.bottom = new FormAttachment( 100, 0 );
    logDisplayText.setLayoutData( fdText );

    sash.setWeights( new int[] { 70, 30, } );
  } else {
    logDisplayText = null;
    sash.setWeights( new int[] { 100, } );
  }
}
 
源代码9 项目: pentaho-kettle   文件: TransHistoryDelegate.java
public TransHistoryLogTab( CTabFolder tabFolder, LogTableInterface logTable ) {
  super( tabFolder, SWT.NONE );
  setLogTable( logTable );

  setText( logTable.getLogTableType() );

  Composite logTableComposite = new Composite( tabFolder, SWT.NONE );
  logTableComposite.setLayout( new FormLayout() );
  spoon.props.setLook( logTableComposite );

  setControl( logTableComposite );

  SashForm sash = new SashForm( logTableComposite, SWT.VERTICAL );
  sash.setLayout( new FillLayout() );
  FormData fdSash = new FormData();
  fdSash.left = new FormAttachment( 0, 0 ); // First one in the left top corner
  fdSash.top = new FormAttachment( 0, 0 );
  fdSash.right = new FormAttachment( 100, 0 );
  fdSash.bottom = new FormAttachment( 100, 0 );
  sash.setLayoutData( fdSash );

  logDisplayTableView = createTransLogTableView( sash );

  if ( logTable.getLogField() != null ) {
    logDisplayText = new Text( sash, SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.READ_ONLY );
    spoon.props.setLook( logDisplayText );
    logDisplayText.setVisible( true );

    FormData fdText = new FormData();
    fdText.left = new FormAttachment( 0, 0 );
    fdText.top = new FormAttachment( 0, 0 );
    fdText.right = new FormAttachment( 100, 0 );
    fdText.bottom = new FormAttachment( 100, 0 );
    logDisplayText.setLayoutData( fdText );

    sash.setWeights( new int[] { 70, 30, } );
  } else {
    logDisplayText = null;
    sash.setWeights( new int[] { 100, } );
  }
}