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

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

源代码1 项目: olca-app   文件: FileImportPage.java
private void mappingFileRow(Composite body) {
	if (!withMappingFile)
		return;
	Composite comp = new Composite(body, SWT.NONE);
	UI.gridLayout(comp, 3, 5, 0);
	UI.gridData(comp, true, false);
	new Label(comp, SWT.NONE).setText("Mapping file");
	Text text = new Text(comp, SWT.BORDER);
	UI.gridData(text, true, false);
	text.setEditable(false);
	text.setBackground(Colors.white());
	Button button = new Button(comp, SWT.NONE);
	button.setText(M.Browse);
	Controls.onSelect(button, e -> {
		mappingFile = FileChooser.open("*.csv");
		if (mappingFile == null) {
			text.setText("");
		} else {
			text.setText(mappingFile.getAbsolutePath());
		}
	});
}
 
源代码2 项目: uima-uimaj   文件: INSDComponentPage.java
/**
 * Adds the text field.
 *
 * @param parent the parent
 * @param strLabel the str label
 * @param strText the str text
 * @param editable the editable
 * @return the text
 */
public Text addTextField(Composite parent, String strLabel, String strText, boolean editable) {
  Label label = new Label(parent, SWT.NULL);
  label.setText(strLabel);

  Text text = new Text(parent, SWT.BORDER | SWT.SINGLE);
  text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  text.setText(strText);
  text.addModifyListener(new ModifyListener() {
    @Override
    public void modifyText(ModifyEvent e) {
      dialogChanged();
    }
  });
  text.setEditable(editable);
  return text;
}
 
源代码3 项目: olca-app   文件: InfoSection.java
public void render(Composite body, FormToolkit toolkit) {
	container = UI.formSection(body, toolkit, M.GeneralInformation, 3);
	Widgets.text(container, M.Name, "name", editor, toolkit);
	Widgets.multiText(container, M.Description, "description", editor, toolkit);
	if (entity.category != null) {
		new Label(container, SWT.NONE).setText(M.Category);
		createBreadcrumb(container);
		new CommentControl(container, toolkit, "category", editor.getComments());
	} else if (editor.hasComment("category")) {
		new Label(container, SWT.NONE).setText(M.Category);
		UI.filler(container);
		new CommentControl(container, toolkit, "category", editor.getComments());
	}
	createVersionText(toolkit);
	Text uuidText = UI.formText(container, toolkit, "UUID");
	uuidText.setEditable(false);
	if (entity.refId != null)
		uuidText.setText(entity.refId);
	UI.filler(container, toolkit);
	createDateText(toolkit);
}
 
源代码4 项目: APICloud-Studio   文件: TrustSSLServerDialog.java
protected Control createDialogArea(Composite parent) {
    Composite rtnGroup = (Composite)super.createDialogArea(parent);
    getShell().setText(Policy.bind("TrustSSLServerDialog.title")); //$NON-NLS-1$
	GridLayout layout = new GridLayout();
	layout.numColumns = 1;
	rtnGroup.setLayout(layout);
	rtnGroup.setLayoutData(
	new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));	

	Text infoText = new Text(rtnGroup, SWT.BORDER | SWT.WRAP | SWT.V_SCROLL);
	GridData data = new GridData();
	data.widthHint = 600;
	data.heightHint = 100;
	infoText.setLayoutData(data);
	infoText.setEditable(false);
	infoText.setText(info);
    
	// set F1 help
	PlatformUI.getWorkbench().getHelpSystem().setHelp(rtnGroup, IHelpContextIds.TRUST_SSL_SERVER_DIALOG);	

    return rtnGroup;
}
 
源代码5 项目: MergeProcessor   文件: WorkspaceMergeDialog.java
/**
 * Creates the text field showing the established commands.
 * 
 * @param parent the parent composite of the text field
 * @return the text field
 */
private static Text createEstablishedCommandsText(final Composite parent) {
	final Composite composite = new Composite(parent, SWT.NONE);
	composite.setLayout(new GridLayout(2, false));
	GridDataFactory.fillDefaults().span(2, 1).exclude(true).applyTo(composite);
	final Text text = new Text(composite, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.CANCEL | SWT.MULTI);
	GridDataFactory.fillDefaults().grab(true, true).hint(0 /* Do not layout dependent to the content */, 100)
			.span(2, 1).applyTo(text);
	text.setEditable(false);
	text.setBackground(text.getDisplay().getSystemColor(SWT.COLOR_BLACK));
	text.setForeground(text.getDisplay().getSystemColor(SWT.COLOR_GRAY));
	text.setFont(JFaceResources.getFont(CONSOLE_FONT));
	return text;
}
 
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 );
}
 
源代码7 项目: arx   文件: ViewCostBenefitModel.java
/**
 * Creates an input field
 * @param caption
 * @param callback
 * @return
 */
private Text createInputField(String caption, final Callback<Double> callback) {

    // Label
    Label label = new Label(root, SWT.NONE);
    label.setText(caption); 
    
    // Text field
    final Text text = new Text(root, SWT.BORDER | SWT.SINGLE);
    text.setText("0"); //$NON-NLS-1$
    text.setToolTipText("0"); //$NON-NLS-1$
    text.setLayoutData(SWTUtil.createFillHorizontallyGridData());
    text.setEditable(false);
    
    // Button
    Button btn1 = new Button(root, SWT.FLAT);
    btn1.setText(Resources.getMessage("ViewCostBenefitModel.0")); //$NON-NLS-1$
    btn1.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent arg0) {
            String value = controller.actionShowInputDialog(root.getShell(), 
                                                            Resources.getMessage("ViewCostBenefitModel.5"),  //$NON-NLS-1$
                                                            Resources.getMessage("ViewCostBenefitModel.6"),  //$NON-NLS-1$
                                                            text.getToolTipText(), 
                                                            validator);
            if (value != null) {
                callback.call(Double.valueOf(value));
                update();
            }
        }
    });
    
    // Return
    return text;
}
 
源代码8 项目: jframe   文件: JframeApp.java
/**
 * @param content
 */
private void createTextDemo(Composite content) {
    final Text text = new Text(content, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
    text.setEditable(false);

    new Thread("HandleMsg") {
        public void run() {
            while (true) {
                shell.getDisplay().asyncExec(new Runnable() {
                    public void run() {
                        if (!text.isDisposed()) {
                            Msg<?> msg = queue.poll();
                            if (msg != null) {
                                if (text.getText().equals(""))
                                    text.setText(msg.toString());
                                else
                                    text.setText(text.getText() + text.getLineDelimiter() + msg.toString());
                            }
                        }
                    }
                });
                if (isDisposed() && queue.isEmpty()) {
                    latch.countDown();
                    break;
                }
                try {
                    Thread.sleep(2000);
                } catch (InterruptedException e) {
                }
            }
        }
    }.start();

}
 
@Override
protected Control createDialogArea(Composite parent) {
	Composite tparent = (Composite) super.createDialogArea(parent);
	GridLayout layout = new GridLayout();
	layout.marginTop = 5;
	layout.marginWidth = 10;
	tparent.setLayout(layout);
	GridData parentData = new GridData(SWT.FILL, SWT.FILL, true, true);
	parentData.heightHint = 380;
	tparent.setLayoutData(parentData);
	
	Label lbl = new Label(tparent, SWT.NONE);
	lbl.setText(Messages.getString("license.LicenseAgreementDialog.label"));
	lbl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	
	Text text = new Text(tparent, SWT.MULTI | SWT.WRAP | SWT.V_SCROLL);
	text.setEditable(false);
	text.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
	text.setText(Messages.getString("license.LicenseAgreementDialog.agreement"));
	GridData textData = new GridData(GridData.FILL_BOTH);
	text.setLayoutData(textData);
	
	agreeBtn = new Button(tparent, SWT.CHECK);
	agreeBtn.setText(Messages.getString("license.LicenseAgreementDialog.agreeBtn"));
	agreeBtn.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	agreeBtn.addSelectionListener(new SelectionAdapter() {

		@Override
		public void widgetSelected(SelectionEvent e) {
			getButton(IDialogConstants.OK_ID).setEnabled(agreeBtn.getSelection());
		}
		
	});
	
	return super.createDialogArea(parent);
}
 
源代码10 项目: offspring   文件: SendMessageWizard.java
@Override
public Control createReadonlyControl(Composite parent) {
  textReferencedReadonly = new Text(parent, SWT.BORDER);
  textReferencedReadonly.setText("");
  textReferencedReadonly.setEditable(false);
  return textReferencedReadonly;
}
 
源代码11 项目: offspring   文件: SendMoneyWizard.java
@Override
public Control createReadonlyControl(Composite parent) {
  textRecipientReadonly = new Text(parent, SWT.BORDER);
  textRecipientReadonly.setText("");
  textRecipientReadonly.setEditable(false);
  return textRecipientReadonly;
}
 
源代码12 项目: tmxeditor8   文件: SplitXliffWizardPage.java
/**
 * 创建要分割文件的显示区
 * @param tparent
 */
public void createSplitXlfNameGroup(Composite tparent) {
	final Group xliffDataGroup = new Group(tparent, SWT.NONE);
	GridLayoutFactory.fillDefaults().numColumns(2).margins(8, 8).applyTo(xliffDataGroup);
	GridDataFactory.fillDefaults().grab(true, false).applyTo(xliffDataGroup);
	xliffDataGroup.setText(Messages.getString("wizard.SplitXliffWizardPage.xliffDataGroup"));

	GridData textData = new GridData(SWT.FILL, SWT.CENTER, true, false);
	textData.widthHint = 200;

	Label xlfNameLbl = new Label(xliffDataGroup, SWT.RIGHT);
	xlfNameLbl.setText(Messages.getString("wizard.SplitXliffWizardPage.xlfNameLbl"));
	GridDataFactory.swtDefaults().align(SWT.RIGHT, SWT.CENTER).applyTo(xlfNameLbl);

	xliffNameTxt = new Text(xliffDataGroup, SWT.BORDER);
	xliffNameTxt.setText(splitFile.getFullPath().toOSString());
	GridDataFactory.fillDefaults().grab(true, false).applyTo(xliffNameTxt);
	xliffNameTxt.setEditable(false);

	Label targetFilsPathLbl = new Label(xliffDataGroup, SWT.RIGHT);
	targetFilsPathLbl.setText(Messages.getString("wizard.SplitXliffWizardPage.targetFilsPathLbl"));
	GridDataFactory.swtDefaults().align(SWT.RIGHT, SWT.CENTER).applyTo(targetFilsPathLbl);

	targetXlfPathTxt = new Text(xliffDataGroup, SWT.BORDER);
	targetXlfPathTxt.setLayoutData(textData);
	targetXlfPathTxt.setText(splitFile.getParent().getFullPath().append(splitFile.getName() + "_split")
			.toOSString());
	targetXlfPathTxt.setEditable(false);

	if ("\\".equals(System.getProperty("file.separator"))) {
		separator = "\\";
	} else {
		separator = "/";
	}

	validXliff();
}
 
源代码13 项目: offspring   文件: CancelSellOrderWizard.java
@Override
public Control createReadonlyControl(Composite parent) {
  Composite comp = new Composite(parent, SWT.NONE);
  GridLayoutFactory.fillDefaults().numColumns(1).applyTo(comp);

  textDescrReadonly = new Text(comp, SWT.BORDER | SWT.MULTI);
  textDescrReadonly.setEditable(false);
  GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true)
      .hint(SWT.DEFAULT, 100).applyTo(textDescrReadonly);

  return comp;
}
 
源代码14 项目: tmxeditor8   文件: Martif2TBXConverterDialog.java
@Override
protected Control createDialogArea(Composite parent) {
	Composite tparent = (Composite) super.createDialogArea(parent);
	tparent.setLayout(new GridLayout(3, false));
	GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).hint(400, 160).grab(true, true).applyTo(tparent);

	createMenu();

	PluginUtil.createLabel(tparent, Messages.getString("dialog.Martif2TBXConverterDialog.txtMartif"));
	txtMartif = new Text(tparent, SWT.BORDER);
	txtMartif.setEditable(false);
	txtMartif.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	btnMartifBrowse = new Button(tparent, SWT.None);
	btnMartifBrowse.setText(Messages.getString("dialog.Martif2TBXConverterDialog.btnMartifBrowse"));

	PluginUtil.createLabel(tparent, Messages.getString("dialog.Martif2TBXConverterDialog.txtTBX"));
	txtTBX = new Text(tparent, SWT.BORDER);
	txtTBX.setEditable(false);
	txtTBX.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	btnTBXBrowse = new Button(tparent, SWT.None);
	btnTBXBrowse.setText(Messages.getString("dialog.Martif2TBXConverterDialog.btnTBXBrowse"));
	initListener();
	
	tparent.layout();
	getShell().layout();
	return tparent;
}
 
源代码15 项目: offspring   文件: IssueAssetWizard.java
@Override
public Control createReadonlyControl(Composite parent) {
  textNameReadonly = new Text(parent, SWT.BORDER);
  textNameReadonly.setText("");
  textNameReadonly.setEditable(false);
  return textNameReadonly;
}
 
源代码16 项目: elexis-3-core   文件: ImporterPage.java
public ODBCBasedImporter(final Composite parent, final ImporterPage home){
	super(parent, SWT.NONE);
	setLayout(new GridLayout());
	final Label lSource = new Label(this, SWT.NONE);
	tSource = new Text(this, SWT.BORDER);
	lSource.setText(Messages.ImporterPage_source); //$NON-NLS-1$
	tSource.setEditable(false);
	lSource.setLayoutData(SWTHelper.getFillGridData(1, true, 1, false));
	tSource.setLayoutData(SWTHelper.getFillGridData(1, true, 1, false));
	tSource.setText(CoreHub.localCfg.get(
		"ImporterPage/" + home.getTitle() + "/ODBC-Source", "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
	home.results = new String[1];
	home.results[0] = tSource.getText();
	Button bSource = new Button(this, SWT.PUSH);
	bSource.setText(Messages.ImporterPage_enter); //$NON-NLS-1$
	bSource.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(final SelectionEvent e){
			InputDialog in =
				new InputDialog(parent.getShell(), Messages.ImporterPage_odbcSource, //$NON-NLS-1$
					Messages.ImporterPage_pleaseEnterODBC, null, null); //$NON-NLS-1$
			if (in.open() == Dialog.OK) {
				tSource.setText(in.getValue());
				home.results[0] = in.getValue();
				CoreHub.localCfg.set(
					"ImporterPage/" + home.getTitle() + "/ODBC-Source", home.results[0]); //$NON-NLS-1$ //$NON-NLS-2$
			}
			
		}
		
	});
	
}
 
源代码17 项目: XPagesExtensionLibrary   文件: WizardUtils.java
public static Text createText(Composite parent, boolean editable) {
    Text text = createText(parent);
    text.setEditable(editable);
    return text;
}
 
源代码18 项目: olca-app   文件: GeoPage.java
private void setupSection(Composite body, FormToolkit tk) {
	Composite comp = UI.formSection(body, tk, "Setup");
	UI.gridLayout(comp, 3);

	// GeoJSON file
	UI.gridLayout(comp, 3);
	UI.gridData(comp, true, false);
	UI.formLabel(comp, tk, "GeoJSON File");
	Text fileText = tk.createText(comp, "");
	fileText.setEditable(false);
	UI.gridData(fileText, false, false).widthHint = 350;
	Button fileBtn = tk.createButton(
			comp, "Open file", SWT.NONE);
	fileBtn.setImage(Icon.FOLDER_OPEN.get());
	Controls.onSelect(fileBtn, _e -> {
		File file = FileChooser.open("*.geojson");
		if (file == null)
			return;
		Setup s = App.exec("Parse GeoJSON ...",
				() -> Setup.read(file));
		if (s == null || s.file == null)
			return;

		// copy possible elementary flow bindings
		// into the new setup (note that the parameters
		// are already initialized in the new setup)
		if (setup != null) {
			s.bindings.addAll(setup.bindings);
		}
		setup = s;
		fileText.setText(s.file);
		paramSection.update();
		flowSection.update();
	});

	UI.filler(comp, tk);
	Composite btnComp = tk.createComposite(comp);
	UI.gridLayout(btnComp, 2, 10, 0);
	Button openBtn = tk.createButton(
			btnComp, "Open setup", SWT.NONE);
	openBtn.setImage(Icon.FOLDER_OPEN.get());
	Button saveBtn = tk.createButton(
			btnComp, "Save setup", SWT.NONE);
	saveBtn.setImage(Icon.SAVE.get());
}
 
源代码19 项目: offspring   文件: TransferAssetWizard.java
@Override
public Control createReadonlyControl(Composite parent) {
  textAmountReadonly = new Text(parent, SWT.BORDER);
  textAmountReadonly.setEditable(false);
  return textAmountReadonly;
}
 
源代码20 项目: offspring   文件: IssueAssetWizard.java
@Override
public Control createReadonlyControl(Composite parent) {
  textQuantityReadonly = new Text(parent, SWT.BORDER);
  textQuantityReadonly.setEditable(false);
  return textQuantityReadonly;
}