• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java SWTObservables类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: bindEditabilityAndCalculatedVariable

import org.eclipse.jface.databinding.swt.SWTObservables; //导入依赖的package包/类
private void bindEditabilityAndCalculatedVariable(DataBindingContext dbc, EObject target, Object feature, Control control) {
	ISWTObservableValue textEditability = SWTObservables.observeEnabled(control);
	IObservableValue calculatedVariableValue = observeCalculatedVariable(target);
	final CalculatedVariable calculatedVariable = getCalculatedVariable(feature);
	UpdateValueStrategy calculatedVariableToEditability = new UpdateValueStrategy() {
		@Override
		public Object convert(Object value) {
			if (value instanceof Set) {
				return !(((Set) value).contains(calculatedVariable));
			}
			if (value == calculatedVariable) {
				return false;
			}
			return true;
		}
	};
	Binding editabilityBinding = dbc.bindValue(textEditability, calculatedVariableValue, null, calculatedVariableToEditability);
	dbc.addBinding(editabilityBinding);
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:20,代码来源:TemporalDetailProvider.java


示例17: setTreeTimelineContentProvider

import org.eclipse.jface.databinding.swt.SWTObservables; //导入依赖的package包/类
public void setTreeTimelineContentProvider(TreeTimelineContentProvider newContentProvider) {
	TreeTimelineContentProvider oldContentProvider = getTreeTimelineContentProvider();
	if (oldContentProvider != null) {
		oldContentProvider.dispose();
	}
	if (newContentProvider != null) {
		newContentProvider.activate();
		if (timeline != null) {
			Control control = timeline.getControl();
			if (control != null) {
				Display display = control.getDisplay();
				Realm realm = SWTObservables.getRealm(display);
				newContentProvider.setRealm(realm);
			}
		}
	}
	setProperty(CONTENT_PROVIDER, newContentProvider);
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:19,代码来源:TimelineViewer.java


示例18: initDataBinding

import org.eclipse.jface.databinding.swt.SWTObservables; //导入依赖的package包/类
private void initDataBinding(){
	transientCodingValue = new WritableValue();
	DataBindingContext bindingContext = new DataBindingContext();
	
	IObservableValue targetObservable = SWTObservables.observeText(codeTxt, SWT.Modify);
	IObservableValue modelObservable = PojoObservables.observeDetailValue(transientCodingValue,
		"code", TransientCoding.class);
	bindingContext.bindValue(targetObservable, modelObservable);
	
	targetObservable = SWTObservables.observeText(displayTxt, SWT.Modify);
	modelObservable = PojoObservables.observeDetailValue(transientCodingValue, "display",
		TransientCoding.class);
	bindingContext.bindValue(targetObservable, modelObservable);
	
	setCoding(null);
}
 
开发者ID:elexis,项目名称:elexis-3-core,代码行数:17,代码来源:CodingComposite.java


示例19: setConnection

import org.eclipse.jface.databinding.swt.SWTObservables; //导入依赖的package包/类
@Override
protected void setConnection ( final Connection connection )
{
    if ( this.privileges != null )
    {
        this.privileges.dispose ();
        this.privileges = null;
    }

    if ( connection != null )
    {
        this.privileges = new PrivilegeSet ( connection, SWTObservables.getRealm ( this.display ) );
        this.viewer.setInput ( this.privileges );
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:16,代码来源:PrivilegeTab.java


示例20: CheckProfileEntry

import org.eclipse.jface.databinding.swt.SWTObservables; //导入依赖的package包/类
public CheckProfileEntry ( 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.CHECK );
    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 ( CheckProfileEntry.this.widget.getSelection () );
        };
    } );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:16,代码来源:CheckProfileEntry.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java S1FPacketSetExperience类代码示例发布时间:2022-05-21
下一篇:
Java CloudletSchedulerTimeShared类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap