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

Java ComboContentAdapter类代码示例

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

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



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

示例1: bindToViewModel

import org.eclipse.jface.fieldassist.ComboContentAdapter; //导入依赖的package包/类
public void bindToViewModel(PatriciaTrie<ContentProposal> proposals, String[] sortedNames) {
	final TagListContentProposalProvider proposalProvider = new TagListContentProposalProvider(proposals);
	ContentProposalAdapter proposalAdapter = new ContentProposalAdapter(
			tagEntry, new ComboContentAdapter(), proposalProvider, null, null);
	proposalAdapter.setPropagateKeys(true);
	proposalAdapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);

	proposalAdapter.addContentProposalListener(new IContentProposalListener() {

		@Override
		public void proposalAccepted(IContentProposal userSelectedProposal) {
			if (proposalProvider.getMakeNewProposal() == userSelectedProposal) {
				for (TagListSelectedEventHandler handler: eventHandlers) {
					handler.requestNewTag(userSelectedProposal.getContent());
					
					clearText();
				}
			}
			addTagInternal(userSelectedProposal.getContent());
		}

	});
	
	tagEntry.setItems(sortedNames);
}
 
开发者ID:sjclemen,项目名称:peten,代码行数:26,代码来源:TagListCombo.java


示例2: ComboAutoCompleteField

import org.eclipse.jface.fieldassist.ComboContentAdapter; //导入依赖的package包/类
/**
 * Constructs an instance of {@link ComboAutoCompleteField}
 * 
 * @param combo the {@link Combo} to auto-complete.
 * @throws NullPointerException if combo parameter is {@code null}
 */
public ComboAutoCompleteField(Combo combo) {
    this.combo = checkNotNull(combo);
    this.adapter = new ContentProposalAdapter(combo, new ComboContentAdapter(), getProposalProvider(), null, null);
    this.adapter.setPropagateKeys(true);
    this.adapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);
    this.proposalStrings = null;
}
 
开发者ID:codenvy-legacy,项目名称:eclipse-plugin,代码行数:14,代码来源:ComboAutoCompleteField.java


示例3: createPartControl

import org.eclipse.jface.fieldassist.ComboContentAdapter; //导入依赖的package包/类
/**
 * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
 */
@Override
public void createPartControl(final Composite parent) {
	// create a new container for sidebar controls
	Composite container = new Composite(parent, SWT.NONE);

	GridLayout layout = new GridLayout();
	container.setLayout(layout);

	// Create a simple field for auto complete.
	Group availableStatistics = new Group(container, SWT.NONE);
	availableStatistics.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	availableStatistics.setLayout(layout);
	availableStatistics.setText(Messages.STATISTICS_LIST_TITLE);

	// Create an auto-complete field
	TreeMap<String, AbstractDataProvider> providers = ArchieActivator.getInstance().getProviderTable();
	String[] availableTitles = providers.keySet().toArray(new String[providers.size()]);

	this.list = new Combo(availableStatistics, SWT.BORDER | SWT.DROP_DOWN);
	this.list.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	this.autoComplete = new AutoCompleteField(this.list, new ComboContentAdapter(), availableTitles);
	this.list.setItems(availableTitles);

	// NOTE: Currently does not work on GTK, any maybe not even on OS X
	// TODO: Add value in Archie preference pane.
	this.list.setVisibleItemCount(5);

	// add listeners
	this.list.addModifyListener(new ModifyListener() {
		public void modifyText(ModifyEvent e) {
			String title = SidebarView.this.list.getText();

			if (SidebarView.this.isValidProviderTitle(title)) {
				AbstractDataProvider provider = ArchieActivator.getInstance().getProviderTable().get(title);
				ProviderManager.getInstance().setProvider(provider);
			} else {
				SidebarView.this.details.reset();
			}
		}
	});

	// Add parameters group.
	Group statisticParameters = new Group(container, SWT.NONE);
	statisticParameters.setLayoutData(new GridData(GridData.FILL_BOTH));
	statisticParameters.setLayout(layout);
	statisticParameters.setText(Messages.STATISTIC_PARAMETERS_TITLE);

	// Add details panel containing details and parameters.
	this.details = new DetailsPanel(statisticParameters, SWT.NONE);
	this.details.addPropertyChangeListener(this);

	// Disable by default if user has no access rights.
	this.setEnabled(ArchieACL.userHasAccess());

	// Register this view for UserChanged events.
	ElexisEventDispatcher.getInstance().addListeners(eeli_user);
}
 
开发者ID:elexis,项目名称:elexis-3-base,代码行数:61,代码来源:SidebarView.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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