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


Java ArrayContentProvider类代码示例

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


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

示例1: createViewer

import org.eclipse.jface.viewers.ArrayContentProvider; //导入依赖的package包/类
public void createViewer(Composite parent){
	
	GridData gridData = new GridData(GridData.FILL_BOTH);
    gridData.horizontalSpan = 2;
	
	viewer = CheckboxTableViewer.newCheckList(parent, SWT.NONE);
	viewer.getTable().setLayoutData(gridData);
	viewer.setContentProvider(new ArrayContentProvider());
	viewer.setLabelProvider(getProvider());
	viewer.setInput(getViewerInput());
	viewer.addCheckStateListener(new ICheckStateListener() {

		public void checkStateChanged(CheckStateChangedEvent event) {
			checkPage();
		}

	});
	checkPage();
	parent.pack();
}
 
开发者ID:Quanticol,项目名称:CARMA,代码行数:21,代码来源:SimulationWizard.java

示例2: createControl

import org.eclipse.jface.viewers.ArrayContentProvider; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void createControl(Composite parent) {
	Composite listComposite = new Composite(parent, NONE);
	listComposite.setLayout(new FillLayout());

	ListViewer projectListViewer = new ListViewer(listComposite, SWT.BORDER | SWT.MULTI);
	projectListViewer.setContentProvider(ArrayContentProvider.getInstance());
	projectListViewer.setInput(getNonTestProjects());

	// Data binding
	DataBindingContext databindingContext = new DataBindingContext();
	parent.addDisposeListener(e -> databindingContext.dispose());

	databindingContext.bindList(ViewersObservables.observeMultiSelection(projectListViewer),
			PojoProperties.list(N4MFProjectInfo.class, N4MFProjectInfo.TESTED_PROJECT_PROP_NAME)
					.observe(projectInfo));

	setControl(listComposite);
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:21,代码来源:N4MFWizardTestedProjectPage.java

示例3: ThreeStateComboChoice

import org.eclipse.jface.viewers.ArrayContentProvider; //导入依赖的package包/类
public ThreeStateComboChoice(Composite parent,ISelectionChangedListener listener) {
	super(parent, SWT.READ_ONLY);
	setContentProvider(ArrayContentProvider.getInstance());
	setLabelProvider(new LabelProvider() {
        @Override
        public String getText(Object element) {
            if (element instanceof ThreeStateChoice) {
            	ThreeStateChoice choice = (ThreeStateChoice) element;
            	return choice.getLabel();	                 
            }
            return "";
        }
    });
	addSelectionChangedListener(listener);
	
	setInput(choices);
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:18,代码来源:ThreeStateComboChoice.java

示例4: createViewer

import org.eclipse.jface.viewers.ArrayContentProvider; //导入依赖的package包/类
@Override
protected ListViewer createViewer(Composite parent) {
    ListViewer viewerObjs = new ListViewer(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
    GridData gd =  new GridData(SWT.FILL, SWT.FILL, true, true, 1, 5);
    gd.widthHint = PREF_PAGE.WIDTH_HINT_PX;
    viewerObjs.getControl().setLayoutData(gd);

    viewerObjs.setContentProvider(ArrayContentProvider.getInstance());
    viewerObjs.setLabelProvider(new LabelProvider() {

        @Override
        public String getText(Object element) {
            return ((DbInfo) element).getName();
        }
    });
    return viewerObjs;
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:18,代码来源:DbStorePrefPage.java

示例5: createControl

import org.eclipse.jface.viewers.ArrayContentProvider; //导入依赖的package包/类
/**
 * Create contents of the wizard.
 * 
 * @param parent
 */
public void createControl(Composite parent) {
  Composite container = new Composite(parent, SWT.NULL);

  setControl(container);
  container.setLayout(new GridLayout(1, false));

  TableViewer tableViewer = new TableViewer(container, SWT.BORDER | SWT.FULL_SELECTION);
  table = tableViewer.getTable();
  table.setLinesVisible(true);
  table.setHeaderVisible(true);
  table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

  tableViewer.setContentProvider(ArrayContentProvider.getInstance());
  tableViewer.setInput(candidateList);
  tableViewer.setLabelProvider(new MarkerColumn());
  // auto size columns
  TableColumn[] columns = tableViewer.getTable().getColumns();
  for (int i = 0; i < columns.length; i++) {
    columns[i].pack();
  }
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:27,代码来源:SelectionWizardPage.java

示例6: createTableControl

import org.eclipse.jface.viewers.ArrayContentProvider; //导入依赖的package包/类
private void createTableControl(Composite container) {
	tableViewer = new TableViewer(container, SWT.FULL_SELECTION | SWT.BORDER);
	String[] columnIndex = new String[] { "主键", "外键", "列名", "名称", "类型", "不能为空", "是否唯一" };
	Integer[] columnWidth = new Integer[] { 40, 40, 120, 120, 120, 80, 80 };
	Integer[] columnAlign = new Integer[] { SWT.CENTER, SWT.CENTER, SWT.LEFT, SWT.LEFT, SWT.LEFT, SWT.CENTER, SWT.CENTER };
	for (int i = 0; i < columnIndex.length; i++) {
		TableViewerColumn choice = new TableViewerColumn(tableViewer, SWT.BORDER);
		choice.getColumn().setText(columnIndex[i]);
		choice.getColumn().setWidth(columnWidth[i]);
		choice.getColumn().setAlignment(columnAlign[i]);
	}
	tableViewer.getTable().setHeaderVisible(true);
	tableViewer.getTable().setLinesVisible(true);
	GridData gd = new GridData(GridData.FILL_BOTH);
	gd.horizontalSpan = 4;
	tableViewer.getTable().setLayoutData(gd);
	tableViewer.setContentProvider(new ArrayContentProvider());
	tableViewer.setLabelProvider(new TableColumnLabelProvider());
	tableViewer.setInput(model.getColumns());
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:21,代码来源:TableModifyWizardPage.java

示例7: postConstruct

import org.eclipse.jface.viewers.ArrayContentProvider; //导入依赖的package包/类
@PostConstruct
public void postConstruct(IEclipseContext context, Composite parent) {
	viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.BORDER);

	// create the columns
	// not yet implemented
	createColumns(viewer);

	// make lines and header visible
	final Table table = viewer.getTable();
	table.setHeaderVisible(true);
	table.setLinesVisible(true);
	viewer.setContentProvider(ArrayContentProvider.getInstance());
	// attach a selection listener to our jface viewer
	viewer.addSelectionChangedListener(ContextInjectionFactory.make(TermSelectionListener.class, context));

}
 
开发者ID:termsuite,项目名称:termsuite-ui,代码行数:18,代码来源:AlignmentResultsPart.java

示例8: openDialog

import org.eclipse.jface.viewers.ArrayContentProvider; //导入依赖的package包/类
private ICoverageLaunch openDialog(ExecutionEvent event,
    List<ICoverageLaunch> launches) {
  final ListDialog dialog = new ListDialog(HandlerUtil.getActiveShell(event)) {
    @Override
    protected void configureShell(Shell shell) {
      super.configureShell(shell);
      ContextHelp.setHelp(shell, ContextHelp.DUMP_EXECUTION_DATA);
    }
  };
  dialog.setTitle(UIMessages.DumpExecutionDataDialog_title);
  dialog.setMessage(UIMessages.DumpExecutionDataDialog_message);
  dialog.setContentProvider(ArrayContentProvider.getInstance());
  dialog.setLabelProvider(new LaunchLabelProvider());
  dialog.setInput(launches);
  if (dialog.open() == Dialog.OK && dialog.getResult().length == 1) {
    return (ICoverageLaunch) dialog.getResult()[0];
  }
  return null;
}
 
开发者ID:eclipse,项目名称:eclemma,代码行数:20,代码来源:DumpExecutionDataHandler.java

示例9: createControl

import org.eclipse.jface.viewers.ArrayContentProvider; //导入依赖的package包/类
public void createControl(Composite parent) {
  initializeDialogUnits(parent);
  parent = new Composite(parent, SWT.NONE);
  parent.setLayout(new GridLayout());
  new Label(parent, SWT.NONE)
      .setText(UIMessages.ExportSessionPage1Sessions_label);
  sessionstable = new TableViewer(parent, SWT.BORDER);
  sessionstable.setLabelProvider(new WorkbenchLabelProvider());
  sessionstable.setContentProvider(ArrayContentProvider.getInstance());
  sessionstable.setInput(CoverageTools.getSessionManager().getSessions());
  ICoverageSession active = CoverageTools.getSessionManager()
      .getActiveSession();
  if (active != null) {
    sessionstable.setSelection(new StructuredSelection(active));
  }
  GridData gd = new GridData(GridData.FILL_BOTH);
  gd.heightHint = convertHeightInCharsToPixels(8);
  sessionstable.getControl().setLayoutData(gd);
  Group group = new Group(parent, SWT.NONE);
  group.setText(UIMessages.ExportSessionPage1DestinationGroup_label);
  group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  createExportOptionsGroup(group);
  setControl(parent);
  ContextHelp.setHelp(parent, ContextHelp.SESSION_EXPORT);
  restoreWidgetValues();
}
 
开发者ID:eclipse,项目名称:eclemma,代码行数:27,代码来源:SessionExportPage1.java

示例10: createTable

import org.eclipse.jface.viewers.ArrayContentProvider; //导入依赖的package包/类
private TableViewer createTable(Composite parent) {
    Table table =   new Table(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.MULTI);
    table.setHeaderVisible(true);
    table.setLinesVisible(true);

    GridData gridData = new GridData(GridData.FILL_BOTH);
    table.setLayoutData(gridData);
    TableLayout layout = new TableLayout();
    table.setLayout(layout);
    
    tableViewer = new TableViewer(table);
    createColumns(table, layout);

    tableViewer.setContentProvider(new ArrayContentProvider());
    tableViewer.setLabelProvider(new PropertiesLabelProvider());
    return tableViewer;
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:18,代码来源:SvnRevPropertiesView.java

示例11: createTable

import org.eclipse.jface.viewers.ArrayContentProvider; //导入依赖的package包/类
private TableViewer createTable(Composite parent) {
	Table table =	new Table(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.MULTI);
	table.setHeaderVisible(true);
	table.setLinesVisible(true);

	GridData gridData = new GridData(GridData.FILL_BOTH);
	table.setLayoutData(gridData);
	TableLayout layout = new TableLayout();
	table.setLayout(layout);
       
	tableViewer = new TableViewer(table);
	createColumns(table, layout);

	tableViewer.setContentProvider(new ArrayContentProvider());
	tableViewer.setLabelProvider(new PropertiesLabelProvider());
	return tableViewer;
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:18,代码来源:SvnPropertiesView.java

示例12: createRuntimeField

import org.eclipse.jface.viewers.ArrayContentProvider; //导入依赖的package包/类
@Override
protected void createRuntimeField(Composite composite) {
  Label runtimeLabel = new Label(composite, SWT.LEAD);
  runtimeLabel.setText(Messages.getString("app.engine.standard.project.runtimetype")); //$NON-NLS-1$
  runtimeField = new ComboViewer(composite, SWT.READ_ONLY);
  runtimeField.setLabelProvider(new LabelProvider() {
    @Override
    public String getText(Object element) {
      return ((AppEngineRuntime) element).getLabel();
    }
  });
  runtimeField.setContentProvider(ArrayContentProvider.getInstance());
  runtimeField.setInput(AppEngineRuntime.STANDARD_RUNTIMES);
  runtimeField.setSelection(new StructuredSelection(DEFAULT_RUNTIME), true);
  runtimeField.addPostSelectionChangedListener(new ISelectionChangedListener() {
    @Override
    public void selectionChanged(SelectionChangedEvent event) {
      revalidate();
    }
  });
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:22,代码来源:AppEngineStandardWizardPage.java

示例13: create

import org.eclipse.jface.viewers.ArrayContentProvider; //导入依赖的package包/类
private void create(Composite parent) {
  displayExecutor = DisplayExecutor.create(parent.getDisplay());
  comboViewer = new ComboViewer(parent, SWT.READ_ONLY | SWT.DROP_DOWN);
  comboViewer.setComparator(new ViewerComparator());
  comboViewer.setLabelProvider(new LabelProvider() {
    @Override
    public String getText(Object element) {
      if (element instanceof GcpProject) {
        GcpProject project = (GcpProject) element;
        return project.getName() + " (" + project.getId() + ")";
      }
      return super.getText(element);
    }
  });
  comboViewer.setContentProvider(ArrayContentProvider.getInstance());
  comboViewer.setInput(EMPTY_PROJECTS);
  parent.addDisposeListener(new DisposeListener() {
    @Override
    public void widgetDisposed(DisposeEvent event) {
      cancelFetch();
    }
  });

  fetch();
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:26,代码来源:MiniSelector.java

示例14: createViewer

import org.eclipse.jface.viewers.ArrayContentProvider; //导入依赖的package包/类
private void createViewer(Composite parent) {
	viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.BORDER);
	createColumns(parent, viewer);
	final Table table = viewer.getTable();
	table.setHeaderVisible(true);
	table.setLinesVisible(true);

	viewer.setContentProvider(new ArrayContentProvider());
	getSite().setSelectionProvider(viewer);

	// define layout for the viewer
	GridData gridData = new GridData();
	gridData.verticalAlignment = GridData.FILL;
	gridData.horizontalSpan = 2;
	gridData.grabExcessHorizontalSpace = true;
	gridData.grabExcessVerticalSpace = true;
	gridData.horizontalAlignment = GridData.FILL;
	viewer.getControl().setLayoutData(gridData);
}
 
开发者ID:secure-software-engineering,项目名称:cheetah,代码行数:20,代码来源:OverviewView.java

示例15: HtrTableWidget

import org.eclipse.jface.viewers.ArrayContentProvider; //导入依赖的package包/类
public HtrTableWidget(Composite parent, int style) {
		super(parent, style);
		
//		this.setLayout(new FillLayout());
//		this.setLayout(SWTUtil.createGridLayout(1, false, 0, 0));
		this.setLayout(new GridLayout(1, false));
//		this.setLayout(new RowLayout(1, true));
				
		htrTv = new MyTableViewer(this, SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION);
		htrTv.setContentProvider(new ArrayContentProvider());
		htrTv.setLabelProvider(new HtrTableLabelProvider(htrTv));
		htrTv.getTable().setLayoutData(new GridData(GridData.FILL_BOTH));
				
		Table table = htrTv.getTable();
		table.setHeaderVisible(true);
//		table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
		
		htrTv.addColumns(HTR_COLS);
		
//		htrTv.getTable().setSortDirection(SWT.UP);
//		htrTv.getTable().setSortColumn(htrTv.getColumn(0));
//		htrTv.refresh();
		
		addFilter();
	}
 
开发者ID:Transkribus,项目名称:TranskribusSwtGui,代码行数:26,代码来源:HtrTableWidget.java


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