当前位置: 首页>>代码示例>>Java>>正文


Java SWTObservables类代码示例

本文整理汇总了Java中org.eclipse.jface.databinding.swt.SWTObservables的典型用法代码示例。如果您正苦于以下问题:Java SWTObservables类的具体用法?Java SWTObservables怎么用?Java SWTObservables使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SWTObservables类属于org.eclipse.jface.databinding.swt包,在下文中一共展示了SWTObservables类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ButtonProfileEntry

import org.eclipse.jface.databinding.swt.SWTObservables; //导入依赖的package包/类
public ButtonProfileEntry ( final DataBindingContext dbc, final Composite parent, final ProfileManager profileManager, final Profile profile, final ChartContext chartContext )
{
    super ( dbc, profileManager, profile, chartContext );

    this.widget = new Button ( parent, SWT.TOGGLE );

    addBinding ( dbc.bindValue ( SWTObservables.observeText ( this.widget ), EMFObservables.observeValue ( profile, ChartPackage.Literals.PROFILE__LABEL ) ) );

    this.widget.addSelectionListener ( new SelectionAdapter () {
        @Override
        public void widgetSelected ( final SelectionEvent e )
        {
            fireSelection ( ButtonProfileEntry.this.widget.getSelection () );
        };
    } );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:17,代码来源:ButtonProfileEntry.java

示例2: bind

import org.eclipse.jface.databinding.swt.SWTObservables; //导入依赖的package包/类
@Override
protected void bind ()
{
    this.dbc.bindValue ( SWTObservables.observeText ( this.label ), this.model, null, new UpdateValueStrategy ().setConverter ( new VariantToStringConverter () ) );
    this.model.addValueChangeListener ( new IValueChangeListener () {

        @Override
        public void handleValueChange ( final ValueChangeEvent event )
        {
            if ( !PlainDataItemLabel.this.label.isDisposed () )
            {
                PlainDataItemLabel.this.label.getParent ().layout ();
            }
        }
    } );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:17,代码来源:PlainDataItemLabel.java

示例3: main

import org.eclipse.jface.databinding.swt.SWTObservables; //导入依赖的package包/类
/**
 * The application entry point
 * 
 * @param args the command line arguments
 */
public static void main(String[] args) {

Realm.runWithDefault(SWTObservables.getRealm(Display.getDefault()), new Runnable() {
	@Override
	public void run() {

		// new ShowProgress().run();

		final Shell shell = new Shell();
		createWidgets(shell);
		shell.pack();

		shell.setLayout(new FillLayout());
		shell.pack();
		shell.open();

		while (!shell.isDisposed()) {
			if (!Display.getCurrent().readAndDispatch()) {
				Display.getCurrent().sleep();
			}
		}

	}
});
}
 
开发者ID:Transkribus,项目名称:TranskribusSwtGui,代码行数:31,代码来源:ShowProgress.java

示例4: createDialogArea

import org.eclipse.jface.databinding.swt.SWTObservables; //导入依赖的package包/类
@Override
protected Control createDialogArea(Composite parent) {
	Composite cmp = (Composite) super.createDialogArea(parent);
	cmp.setLayout(new GridLayout(5, false));

	DataBindingContext bindingContext = new DataBindingContext();

	new Label(cmp, SWT.NONE).setText(Messages.CreateParameterCommand_parameter_name);

	Combo operator = new Combo(cmp, SWT.READ_ONLY);
	JRDesignDataset ds = value.getRoot().getValue();
	List<JRParameter> prms = ds.getParametersList();
	String[] items = new String[prms.size()];
	for (int i = 0; i < items.length; i++)
		items[i] = prms.get(i).getName();
	operator.setItems(items);
	operator.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));

	bindingContext.bindValue(SWTObservables.observeSelection(operator), PojoObservables.observeValue(this, "prm")); //$NON-NLS-1$
	return cmp;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:22,代码来源:EditPNotExpressionDialog.java

示例5: createWidget

import org.eclipse.jface.databinding.swt.SWTObservables; //导入依赖的package包/类
@Override
protected void createWidget(Composite parent) {
	GridLayout layout = new GridLayout(2, false);
	layout.marginHeight = 2;
	layout.marginWidth = 0;
	layout.horizontalSpacing = 0;
	layout.verticalSpacing = 0;
	setLayout(layout);

	txt = new Text(this, SWT.BORDER);
	txt.setText(getValue().toSQLString());
	txt.setToolTipText(getValue().toSQLString());
	GridData gd = new GridData(GridData.FILL_HORIZONTAL);
	gd.minimumWidth = 250;
	txt.setLayoutData(gd);

	DataBindingContext bindingContext = new DataBindingContext();
	bindingContext.bindValue(SWTObservables.observeText(txt, SWT.Modify), PojoObservables.observeValue(getValue(), "value")); //$NON-NLS-1$
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:20,代码来源:UnknownOperandWidget.java

示例6: createWidget

import org.eclipse.jface.databinding.swt.SWTObservables; //导入依赖的package包/类
@Override
protected void createWidget(Composite parent) {
	GridLayout layout = new GridLayout(2, false);
	layout.marginHeight = 2;
	layout.marginWidth = 0;
	layout.horizontalSpacing = 0;
	layout.verticalSpacing = 0;
	setLayout(layout);

	txt = new Text(this, SWT.BORDER);
	txt.setText(getValue().toSQLString());
	txt.setToolTipText(getValue().toSQLString());
	GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_CENTER);
	gd.widthHint = 100;
	txt.setLayoutData(gd);

	DataBindingContext bindingContext = new DataBindingContext();

	bindingContext.bindValue(SWTObservables.observeText(txt, SWT.Modify), PojoObservables.observeValue(getValue(), "value"));

}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:22,代码来源:NumberWidget.java

示例7: createWidget

import org.eclipse.jface.databinding.swt.SWTObservables; //导入依赖的package包/类
@Override
protected void createWidget(Composite parent) {
	GridLayout layout = new GridLayout(2, false);
	layout.marginHeight = 2;
	layout.marginWidth = 0;
	layout.horizontalSpacing = 0;
	layout.verticalSpacing = 0;
	setLayout(layout);

	txt = new Text(this, SWT.BORDER);
	txt.setText(getValue().toSQLString());
	txt.setToolTipText(getValue().toSQLString());
	txt.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

	DataBindingContext bindingContext = new DataBindingContext();
	bindingContext.bindValue(SWTObservables.observeText(txt, SWT.Modify), PojoObservables.observeValue(getValue(), "value")); //$NON-NLS-1$
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:18,代码来源:StringWidget.java

示例8: bindAWS

import org.eclipse.jface.databinding.swt.SWTObservables; //导入依赖的package包/类
private void bindAWS() {
	List<ResourceProperty> props = res.getValue().getProperties();

	ResourceProperty resprop = ResourceDescriptorUtil.getProperty(MRDatasourceAWS.PROP_DATASOURCE_AWS_ACCESS_KEY, props);
	if (resprop != null)
		bAccessKey = bindingContext.bindValue(SWTObservables.observeText(awsAccessKey, SWT.Modify), PojoObservables.observeValue(resprop, "value"));

	resprop = ResourceDescriptorUtil.getProperty(MRDatasourceAWS.PROP_DATASOURCE_AWS_SECRET_KEY, props);
	if (resprop != null)
		bSecretKey = bindingContext.bindValue(SWTObservables.observeText(awsSecretKey, SWT.Modify), PojoObservables.observeValue(resprop, "value"));

	resprop = ResourceDescriptorUtil.getProperty(MRDatasourceAWS.PROP_DATASOURCE_AWS_ROLE_ARN, props);

	if (resprop != null)
		bArn = bindingContext.bindValue(SWTObservables.observeText(awsArn, SWT.Modify), PojoObservables.observeValue(resprop, "value"));
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:17,代码来源:DatasourceAWSPageContent.java

示例9: createContent

import org.eclipse.jface.databinding.swt.SWTObservables; //导入依赖的package包/类
@Override
public Control createContent(Composite parent) {
	Composite cmp = new Composite(parent, SWT.NONE);
	cmp.setLayout(new GridLayout(2, false));

	UIUtil.createLabel(cmp, "Catalog");

	Text tCatalog = new Text(cmp, SWT.BORDER);
	tCatalog.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

	List<ResourceProperty> props = res.getValue().getProperties();
	ResourceProperty resprop = ResourceDescriptorUtil.getProperty(ResourceDescriptor.PROP_XMLA_CATALOG, props);

	bindingContext.bindValue(SWTObservables.observeText(tCatalog, SWT.Modify), PojoObservables.observeValue(resprop, "value"));

	Control c = super.createContent(cmp);
	GridData gd = new GridData(GridData.FILL_BOTH);
	gd.horizontalSpan = 2;
	c.setLayoutData(gd);
	return cmp;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:22,代码来源:MondrianXMLADefinitionContent.java

示例10: bind

import org.eclipse.jface.databinding.swt.SWTObservables; //导入依赖的package包/类
protected void bind() {
	bindingContext.bindValue(SWTObservables.observeText(tparent, SWT.NONE),
			PojoObservables.observeValue(res.getValue(), "parentFolder"));

	bindingContext.bindValue(SWTObservables.observeText(tid, SWT.Modify),
			PojoObservables.observeValue(res.getValue(), "name"));

	bindingContext.bindValue(SWTObservables.observeText(tcdate, SWT.NONE),
			PojoObservables.observeValue(res.getValue(), "creationDate"));

	bindingContext.bindValue(SWTObservables.observeText(ttype, SWT.NONE),
			PojoObservables.observeValue(res.getValue(), "wsType"));

	bindingContext.bindValue(SWTObservables.observeText(tname, SWT.Modify),
			PojoObservables.observeValue(res.getValue(), "label"));
	bindingContext.bindValue(SWTObservables.observeText(tdesc, SWT.Modify),
			PojoObservables.observeValue(res.getValue(), "description"));
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:19,代码来源:CommonSection.java

示例11: bind

import org.eclipse.jface.databinding.swt.SWTObservables; //导入依赖的package包/类
protected void bind() {
	bindingContext.bindValue(
			SWTObservables.observeText(tpattern, SWT.Modify),
			PojoObservables.observeValue(res.getValue(), "pattern"));
	bindingContext.bindValue(SWTObservables.observeText(tmin, SWT.Modify),
			PojoObservables.observeValue(res.getValue(), "minValue"));
	bindingContext.bindValue(SWTObservables.observeText(tmax, SWT.Modify),
			PojoObservables.observeValue(res.getValue(), "maxValue"));
	bindingContext.bindValue(SWTObservables.observeSelection(bmin),
			PojoObservables.observeValue(res.getValue(), "strictMin"));
	bindingContext.bindValue(SWTObservables.observeSelection(bmax),
			PojoObservables.observeValue(res.getValue(), "strictMax"));

	bindingContext.bindValue(SWTObservables
			.observeSingleSelectionIndex(ttype), PojoObservables
			.observeValue(getProxy(res.getValue()), "dataType"));
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:18,代码来源:DataTypeSection.java

示例12: bindWidgets

import org.eclipse.jface.databinding.swt.SWTObservables; //导入依赖的package包/类
@Override
protected void bindWidgets(DataAdapter dataAdapter) {
	JdbcDataAdapter jdbcDataAdapter = (JdbcDataAdapter) dataAdapter;

	String driverName = Misc.nvl(jdbcDataAdapter.getDriver(), "org.hsqldb.jdbcDriver"); //$NON-NLS-1$
	comboJDBCDriver.getCombo().setText(driverName);

	for (JDBCDriverDefinition d : definitions) {
		if (d.getDriverName().equals(driverName)) {
			currentdriver = d;
			break;
		}
	}

	bindingContext.bindValue(SWTObservables.observeText(textUsername, SWT.Modify), PojoObservables.observeValue(dataAdapter, "username")); //$NON-NLS-1$
	bindingContext.bindValue(SWTObservables.observeText(textPassword, SWT.Modify), PojoObservables.observeValue(dataAdapter, "password")); //$NON-NLS-1$
	bindURLAssistant(dataAdapter);
	bindingContext.bindValue(SWTObservables.observeText(textJDBCUrl, SWT.Modify), PojoObservables.observeValue(dataAdapter, "url")); //$NON-NLS-1$

	cpath.setClasspaths(jdbcDataAdapter.getClasspath());
	cproperties.setProperties(jdbcDataAdapter.getProperties());
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:23,代码来源:JDBCDataAdapterComposite.java

示例13: bindWidgets

import org.eclipse.jface.databinding.swt.SWTObservables; //导入依赖的package包/类
@Override
protected void bindWidgets(DataAdapter dataAdapter) {
	BeanDataAdapter bda = (BeanDataAdapter) dataAdapter;

	bindingContext.bindValue(SWTObservables.observeText(
			factoryText.getControl(), SWT.Modify), PojoObservables
			.observeValue(dataAdapter, "factoryClass")); //$NON-NLS-1$

	bindingContext.bindValue(
			SWTObservables.observeText(methodText, SWT.Modify),
			PojoObservables.observeValue(dataAdapter, "methodName")); //$NON-NLS-1$
	bindingContext.bindValue(SWTObservables.observeSelection(useFDcheck),
			PojoObservables
					.observeValue(dataAdapter, "useFieldDescription")); //$NON-NLS-1$

	cpath.setClasspaths(bda.getClasspath());
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:18,代码来源:BeanDataAdapterComposite.java

示例14: createContents

import org.eclipse.jface.databinding.swt.SWTObservables; //导入依赖的package包/类
@Override
protected Control createContents(Composite parent) {
	Control control = super.createContents(parent);

	DataBindingContext binding = new DataBindingContext();

	ControlDecoration controlDecoration = new ControlDecoration(tname, SWT.LEFT | SWT.TOP);
	controlDecoration.setDescriptionText(Messages.ThemesPreferencePage_duplicateName);
	FieldDecoration fieldDecoration = FieldDecorationRegistry.getDefault().getFieldDecoration(
			FieldDecorationRegistry.DEC_ERROR);
	controlDecoration.setImage(fieldDecoration.getImage());

	binding.bindValue(SWTObservables.observeText(tname, SWT.Modify), PojoObservables.observeValue(this, "themename"), //$NON-NLS-1$
			new UpdateValueStrategy().setAfterConvertValidator(new StringRequiredValidator(Messages.ThemesPreferencePage_enternameMessage,
					controlDecoration, getButton(IDialogConstants.OK_ID))), null);

	return control;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:19,代码来源:ThemesPreferencePage.java

示例15: createBinding

import org.eclipse.jface.databinding.swt.SWTObservables; //导入依赖的package包/类
private void createBinding(DataBindingContext dbc, Text text, DuplexingObservableValue observable) {
	dbc.addBinding(dbc.bindValue(
			SWTObservables.observeText(text, SWT.FocusOut), 
			observable, 
			new StringifierUpdateValueStrategy(UpdateValueStrategy.POLICY_UPDATE), 
			new StringifierUpdateValueStrategy(UpdateValueStrategy.POLICY_UPDATE) {

				@Override
				public Object convert(Object value) {
					String string = (String) super.convert(value);
					if (string.startsWith("-")) {
						string = string.substring(1);
					}
					return string;
				}
				
			}));
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:19,代码来源:TemporalPropertyDescriptorContributor.java


注:本文中的org.eclipse.jface.databinding.swt.SWTObservables类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。