本文整理匯總了Java中org.eclipse.jface.viewers.CheckboxTableViewer.setInput方法的典型用法代碼示例。如果您正苦於以下問題:Java CheckboxTableViewer.setInput方法的具體用法?Java CheckboxTableViewer.setInput怎麽用?Java CheckboxTableViewer.setInput使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.jface.viewers.CheckboxTableViewer
的用法示例。
在下文中一共展示了CheckboxTableViewer.setInput方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: makeTable
import org.eclipse.jface.viewers.CheckboxTableViewer; //導入方法依賴的package包/類
protected TableViewer makeTable(final Composite parent) {
CheckboxTableViewer tableViewer = CheckboxTableViewer.newCheckList(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.CHECK);
tableViewer.setContentProvider(new ArrayContentProvider());
tableViewer.setInput(markerList);
tableViewer.setLabelProvider(getLabelProvider());
tableViewer.addSelectionChangedListener(event -> {
Object marker = ((StructuredSelection) event.getSelection()).getFirstElement();
if(marker instanceof IMarker) {
openEditor((IMarker) marker);
}
});
tableViewer.addCheckStateListener(getCheckStateListener());
return tableViewer;
}
示例2: createNewFilePage
import org.eclipse.jface.viewers.CheckboxTableViewer; //導入方法依賴的package包/類
@Override
protected WizardNewFileCreationPage createNewFilePage() {
return new NewFilePage(getSelection(), fileExt) {
@Override
public void createControl(Composite parent) {
super.createControl(parent);
Composite control = (Composite) getControl();
Composite extensionGroup = new Composite(control, SWT.NONE);
GridLayout layout = new GridLayout();
layout.numColumns = 2;
extensionGroup.setLayout(layout);
extensionGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Label refOccieLabel = new Label(extensionGroup, SWT.NONE);
refOccieLabel.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, true, true));
refOccieLabel.setText(Messages.NewExtensionWizard_RefExtensionLabel);
refOccieLabel.setFont(parent.getFont());
Composite composite = new Composite(extensionGroup, SWT.NULL);
GridData layoutData = new GridData(SWT.FILL, SWT.FILL, true, true);
composite.setLayoutData(layoutData);
TableColumnLayout tableLayout = new TableColumnLayout();
composite.setLayout(tableLayout);
Table table = new Table(composite,
SWT.CHECK | SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
refExtensionViewer = new CheckboxTableViewer(table);
refExtensionViewer.setContentProvider(ArrayContentProvider.getInstance());
Collection<String> registeredExtensions = new ArrayList<String>(
OcciRegistry.getInstance().getRegisteredExtensions());
refExtensionViewer.setInput(registeredExtensions);
}
};
}
示例3: setSerializedInput
import org.eclipse.jface.viewers.CheckboxTableViewer; //導入方法依賴的package包/類
/**
* Performs the inverse operation to {@link FormHelper#getSerializedInput(CheckboxTableViewer)}
*/
public static void setSerializedInput(TableViewer table, List<String> serializedInput)
{
@SuppressWarnings("unchecked")
Vector<Formula> input = ((Vector<Formula>) table.getInput());
if (input == null)
{
input = new Vector<Formula>();
}
// handling Formulas
if (table instanceof CheckboxTableViewer)
{
Iterator<String> serializedIterator = serializedInput.iterator();
Vector<Formula> checked = new Vector<Formula>();
CheckboxTableViewer checkTable = (CheckboxTableViewer) table;
while (serializedIterator.hasNext())
{
String entry = serializedIterator.next();
Formula formula = new Formula(entry.substring(1));
input.add(formula);
if ("1".equals(entry.substring(0, 1)))
{
checked.add(formula);
}
}
checkTable.setInput(input);
checkTable.setCheckedElements(checked.toArray());
} else
// handling Assignments
{
List<Assignment> deserializeAssignmentList = ModelHelper.deserializeAssignmentList(serializedInput);
table.setInput(deserializeAssignmentList);
}
}
示例4: createTableViewer
import org.eclipse.jface.viewers.CheckboxTableViewer; //導入方法依賴的package包/類
protected CheckboxTableViewer createTableViewer(Composite parent) {
final CheckboxTableViewer result= CheckboxTableViewer.newCheckList(parent, SWT.BORDER | SWT.MULTI);
result.addCheckStateListener(new ICheckStateListener() {
public void checkStateChanged(CheckStateChangedEvent event) {
GrayedCheckedModelElement element= (GrayedCheckedModelElement)event.getElement();
result.setGrayed(element, false);
if (event.getChecked()) {
element.select();
} else {
element.deselect();
}
result.update(element, null);
}
});
GridData data= new GridData(GridData.FILL_BOTH);
data.heightHint= convertHeightInCharsToPixels(20);
data.widthHint= convertWidthInCharsToPixels(50);
result.getTable().setLayoutData(data);
result.addFilter(new Filter());
result.setLabelProvider(new GrayedCheckedModelLabelProvider());
result.setSorter(new GrayedCheckModelElementSorter());
result.setContentProvider(new GrayedCheckedModelContentProvider());
result.setInput(fModel);
result.setCheckedElements(fModel.getChecked());
result.setGrayedElements(fModel.getGrayed());
return result;
}
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:32,代碼來源:ConfigureWorkingSetAssignementAction.java
示例5: showDiscoveredLibraries
import org.eclipse.jface.viewers.CheckboxTableViewer; //導入方法依賴的package包/類
private void showDiscoveredLibraries(Text pathText, CheckboxTableViewer libViewer, boolean isCore) {
if (pathText == null) return;
System.out.println("OS.helper().getNewLibraryPath(): " + OS.helper().getNewLibraryPath());
String test = pathText.getText();
if(OS.helper() instanceof MacOSHelper){
((MacOSHelper)OS.helper()).resetProcessingPath();
}
File librariesDir = new File(pathText.getText(),
OS.helper().getLibraryPath());
if (!librariesDir.exists()) {
librariesDir = new File(pathText.getText(),
OS.helper().getNewLibraryPath());
if (!librariesDir.exists() && OS.helper() instanceof MacOSHelper) {
OS.helper().tryProcessing2_0bpath();
OS.helper().tryProcessing2_0bpath();
librariesDir = new File(pathText.getText(), OS.helper().getNewLibraryPath());
}
}
if(!isCore){
librariesDir = new File(pathText.getText(),
OS.helper().getSketchPath());
}
List<String> libraries = new ArrayList<String>();
if (librariesDir.exists()) {
String[] files = librariesDir.list();
for (String file : files) {
if ((new File(librariesDir, file)).isDirectory())
libraries.add(file);
}
}
libViewer.setInput(libraries.toArray(new String[libraries.size()]));
}
示例6: createControl
import org.eclipse.jface.viewers.CheckboxTableViewer; //導入方法依賴的package包/類
@Override
public void createControl(Composite parent) {
super.createControl(parent);
Composite control = (Composite) getControl();
Composite extensionGroup = new Composite(control, SWT.NONE);
GridLayout layout = new GridLayout();
layout.numColumns = 2;
extensionGroup.setLayout(layout);
extensionGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Label refOccieLabel = new Label(extensionGroup, SWT.NONE);
refOccieLabel.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, true, true));
refOccieLabel.setText(Messages.NewConnectorWizard_RefExtensionLabel);
refOccieLabel.setFont(parent.getFont());
Composite composite = new Composite(extensionGroup, SWT.NULL);
GridData layoutData = new GridData(SWT.FILL, SWT.FILL, true, true);
composite.setLayoutData(layoutData);
TableColumnLayout tableLayout = new TableColumnLayout();
composite.setLayout(tableLayout);
Table table = new Table(composite,
SWT.CHECK | SWT.SINGLE | SWT.BORDER | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
refExtensionViewer = new CheckboxTableViewer(table);
refExtensionViewer.setContentProvider(ArrayContentProvider.getInstance());
refExtensionViewer.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
setPageComplete(validatePage());
}
});
Collection<String> registeredExtensions = new ArrayList<String>(
OcciRegistry.getInstance().getRegisteredExtensions());
// removed the OCCI core extension as it is added by default.
registeredExtensions.remove(OcciCoreConstants.OCCI_CORE_SCHEME);
refExtensionViewer.setInput(registeredExtensions);
}
示例7: createUserAgentTable
import org.eclipse.jface.viewers.CheckboxTableViewer; //導入方法依賴的package包/類
/**
* createUserAgentTable
*
* @param parent
*/
protected void createUserAgentTable(Composite parent)
{
Label label = new Label(parent, SWT.WRAP);
label.setText(Messages.UserAgentPreferencePage_Select_User_Agents);
label.setLayoutData(GridDataFactory.fillDefaults().span(2, 0).grab(true, true).create());
Composite composite = new Composite(parent, SWT.NONE);
composite.setLayout(GridLayoutFactory.fillDefaults().create());
composite.setLayoutData(GridDataFactory.fillDefaults().span(2, 0).hint(400, 120).grab(true, true).create());
Table table = new Table(composite, SWT.CHECK | SWT.BORDER | SWT.SINGLE);
table.setFont(parent.getFont());
categoryViewer = new CheckboxTableViewer(table);
categoryViewer.getControl().setFont(parent.getFont());
categoryViewer.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));
categoryViewer.setContentProvider(ArrayContentProvider.getInstance());
CategoryLabelProvider categoryLabelProvider = new CategoryLabelProvider(true);
categoryViewer.setLabelProvider(categoryLabelProvider);
categoryViewer.setComparator(new ViewerComparator()
{
@Override
public int compare(Viewer viewer, Object e1, Object e2)
{
if (e1 instanceof IUserAgent && e2 instanceof IUserAgent)
{
IUserAgent ua1 = (IUserAgent) e1;
IUserAgent ua2 = (IUserAgent) e2;
String uaName1 = StringUtil.getStringValue(ua1.getName());
String uaName2 = StringUtil.getStringValue(ua2.getName());
return uaName1.compareToIgnoreCase(uaName2);
}
return super.compare(viewer, e1, e2);
}
});
categoryViewer.setInput(UserAgentManager.getInstance().getAllUserAgents());
}
示例8: createLanguagePackFilteredListArea
import org.eclipse.jface.viewers.CheckboxTableViewer; //導入方法依賴的package包/類
private void createLanguagePackFilteredListArea(Composite parent) {
fLanguagePackListLabel = new Label(parent, SWT.NONE);
fLanguagePackListLabel.setText(Messages.getString("BuildToolWizardConfigurationPage_IgnoreListLabel")); //$NON-NLS-1$
GridData gdLabel = new GridData(GridData.FILL_HORIZONTAL);
gdLabel.widthHint = LABEL_WIDTH;
gdLabel.horizontalIndent = LIST_LABEL_INDENT;
gdLabel.verticalIndent = LIST_SEPARATOR;
fLanguagePackListLabel.setLayoutData(gdLabel);
Composite listComposite = new Composite(parent, SWT.NONE);
listComposite.setLayout(new GridLayout(2, false));
listComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
Table table = new Table(listComposite, SWT.CHECK | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
table.setLayout(new TableLayout());
GridData data = new GridData(GridData.FILL_BOTH);
data.heightHint = VIEWER_HEIGHT;
data.widthHint = VIEWER_WIDTH;
table.setLayoutData(data);
fLanguagePackResourceIgnoreViewer = new CheckboxTableViewer(table);
fLanguagePackResourceIgnoreViewer.setLabelProvider(new LabelProvider());
fLanguagePackResourceIgnoreViewer.setContentProvider(new IgnoreListContentProvider());
fLanguagePackResourceIgnoreViewer.setInput(fModelIgnoreTable.getModels());
fLanguagePackResourceIgnoreViewer.setComparator(new ViewerComparator());
fLanguagePackResourceIgnoreViewer.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
// Enable button only if there's a selection
if (event.getSelection().isEmpty()) {
fRemoveLanguagePackFilterButton.setEnabled(false);
} else {
fRemoveLanguagePackFilterButton.setEnabled(true);
}
}
});
// By default, all pre-defined patterns are checked
fLanguagePackResourceIgnoreViewer.setAllChecked(true);
createLanguagePackFilteredListControlButtonsArea(listComposite);
}
示例9: createCoverageReportFilteredListArea
import org.eclipse.jface.viewers.CheckboxTableViewer; //導入方法依賴的package包/類
private void createCoverageReportFilteredListArea(Composite parent) {
fCoverageReportListLabel = new Label(parent, SWT.NONE);
fCoverageReportListLabel.setText(Messages.getString("BuildToolWizardConfigurationPage_FilterListLabel")); //$NON-NLS-1$
GridData gdLabel = new GridData(GridData.FILL_HORIZONTAL);
gdLabel.widthHint = LABEL_WIDTH;
gdLabel.horizontalIndent = LIST_LABEL_INDENT;
gdLabel.verticalIndent = LIST_SEPARATOR;
fCoverageReportListLabel.setLayoutData(gdLabel);
Composite listComposite = new Composite(parent, SWT.NONE);
listComposite.setLayout(new GridLayout(2, false));
listComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
Table table = new Table(listComposite, SWT.CHECK | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
table.setLayout(new TableLayout());
GridData data = new GridData(GridData.FILL_BOTH);
data.heightHint = VIEWER_HEIGHT;
data.widthHint = VIEWER_WIDTH;
table.setLayoutData(data);
fCoverageReportResourceFilterViewer = new CheckboxTableViewer(table);
fCoverageReportResourceFilterViewer.setLabelProvider(new LabelProvider());
fCoverageReportResourceFilterViewer.setContentProvider(new ExcludeListContentProvider());
fCoverageReportResourceFilterViewer.setInput(fModelResourceExclusionTable.getModels());
fCoverageReportResourceFilterViewer.setComparator(new ViewerComparator());
fCoverageReportResourceFilterViewer.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
// Enable button only if there's a selection
if (event.getSelection().isEmpty()) {
fRemoveCoverageReportFilterButton.setEnabled(false);
} else {
fRemoveCoverageReportFilterButton.setEnabled(true);
}
}
});
// By default, all pre-defined filters are checked
fCoverageReportResourceFilterViewer.setAllChecked(true);
// Create an area with buttons for adding/removing resource patterns, and for selecting/deselecting all
createExcludeListControlButtonArea(listComposite);
IDialogSettings settings = getDialogSettings();
for(String filter : not_null(settings.getArray(EXCLUDE_LIST), new String[]{})){
addCoverageReportFilter(filter, false);
}
for(String checked : not_null(settings.getArray(EXCLUDE_LIST_CHECKED), new String[]{})){
addCoverageReportFilter(checked, true);
}
}
示例10: createDialogArea
import org.eclipse.jface.viewers.CheckboxTableViewer; //導入方法依賴的package包/類
@Override
protected Control createDialogArea(Composite parent) {
Composite area = (Composite) super.createDialogArea(parent);
Composite container = new Composite(area, SWT.NONE);
container.setLayoutData(new GridData(GridData.FILL_BOTH));
GridLayout layout = new GridLayout(2, false);
container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
container.setLayout(layout);
/*
*
* createFirstName(container); createLastName(container);
*/
table = new Table(container, SWT.CHECK | SWT.SINGLE | SWT.H_SCROLL
| SWT.V_SCROLL | SWT.FULL_SELECTION);
String[] colLabels = getColumnLabels();
int columnWidth[] = getColumnWidth();
SortListener sortListener = new SortListener();
TableColumn[] cols = new TableColumn[colLabels.length];
for (int i = 0; i < colLabels.length; i++) {
cols[i] = new TableColumn(table, SWT.NONE);
cols[i].setWidth(columnWidth[i]);
cols[i].setText(colLabels[i]);
cols[i].setData(new Integer(i));
cols[i].addSelectionListener(sortListener);
}
GridData gridDataTable = new GridData();
gridDataTable.horizontalAlignment = GridData.FILL;
gridDataTable.verticalAlignment = GridData.FILL;
gridDataTable.grabExcessHorizontalSpace = true;
gridDataTable.grabExcessVerticalSpace = true;
table.setLayoutData(gridDataTable);
table.setHeaderVisible(true);
table.setLinesVisible(true);
tableViewer = new CheckboxTableViewer(table);
tableViewer.setContentProvider(new ViewContentProvider());
tableViewer.setLabelProvider(new ViewLabelProvider());
tableViewer.setSorter(new Sorter());
tableViewer.setInput(this);
return area;
}
示例11: createDialogArea
import org.eclipse.jface.viewers.CheckboxTableViewer; //導入方法依賴的package包/類
@Override
protected Control createDialogArea(Composite parent) {
Composite area = (Composite) super.createDialogArea(parent);
Composite container = new Composite(area, SWT.NONE);
container.setLayoutData(new GridData(GridData.FILL_BOTH));
GridLayout layout = new GridLayout(2, false);
container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
container.setLayout(layout);
table = new Table(container, SWT.CHECK | SWT.SINGLE | SWT.H_SCROLL
| SWT.V_SCROLL | SWT.FULL_SELECTION);
String[] colLabels = getColumnLabels();
int columnWidth[] = getColumnWidth();
SortListener sortListener = new SortListener();
TableColumn[] cols = new TableColumn[colLabels.length];
for (int i = 0; i < colLabels.length; i++) {
cols[i] = new TableColumn(table, SWT.NONE);
cols[i].setWidth(columnWidth[i]);
cols[i].setText(colLabels[i]);
cols[i].setData(new Integer(i));
cols[i].addSelectionListener(sortListener);
}
GridData gridDataTable = new GridData();
gridDataTable.horizontalAlignment = GridData.FILL;
gridDataTable.verticalAlignment = GridData.FILL;
gridDataTable.grabExcessHorizontalSpace = true;
gridDataTable.grabExcessVerticalSpace = true;
table.setLayoutData(gridDataTable);
table.setHeaderVisible(true);
table.setLinesVisible(true);
tableViewer = new CheckboxTableViewer(table);
tableViewer.setContentProvider(new ViewContentProvider());
tableViewer.setLabelProvider(new ViewLabelProvider());
tableViewer.setSorter(new PatientSorter());
tableViewer.setInput(this);
return area;
}
示例12: createDialogArea
import org.eclipse.jface.viewers.CheckboxTableViewer; //導入方法依賴的package包/類
@Override
protected Control createDialogArea(Composite parent) {
Composite area = (Composite) super.createDialogArea(parent);
Composite container = new Composite(area, SWT.NONE);
container.setLayoutData(new GridData(GridData.FILL_BOTH));
GridLayout layout = new GridLayout(2, false);
container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
container.setLayout(layout);
/*
*
* createFirstName(container); createLastName(container);
*/
table = new Table(container, SWT.CHECK | SWT.SINGLE | SWT.H_SCROLL
| SWT.V_SCROLL | SWT.FULL_SELECTION);
String[] colLabels = getColumnLabels();
int columnWidth[] = getColumnWidth();
SortListener sortListener = new SortListener();
TableColumn[] cols = new TableColumn[colLabels.length];
for (int i = 0; i < colLabels.length; i++) {
cols[i] = new TableColumn(table, SWT.NONE);
cols[i].setWidth(columnWidth[i]);
cols[i].setText(colLabels[i]);
cols[i].setData(new Integer(i));
cols[i].addSelectionListener(sortListener);
}
GridData gridDataTable = new GridData();
gridDataTable.horizontalAlignment = GridData.FILL;
gridDataTable.verticalAlignment = GridData.FILL;
gridDataTable.grabExcessHorizontalSpace = true;
gridDataTable.grabExcessVerticalSpace = true;
table.setLayoutData(gridDataTable);
table.setHeaderVisible(true);
table.setLinesVisible(true);
tableViewer = new CheckboxTableViewer(table);
tableViewer.setContentProvider(new ViewContentProvider());
tableViewer.setLabelProvider(new ViewLabelProvider());
tableViewer.setSorter(new Sorter());
tableViewer.setInput(this);
return area;
}