本文整理匯總了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();
}
示例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);
}
示例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);
}
示例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;
}
示例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();
}
}
示例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());
}
示例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));
}
示例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;
}
示例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();
}
示例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;
}
示例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;
}
示例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();
}
});
}
示例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();
}
示例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);
}
示例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();
}