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


Java CheckboxTableViewer.newCheckList方法代码示例

本文整理汇总了Java中org.eclipse.jface.viewers.CheckboxTableViewer.newCheckList方法的典型用法代码示例。如果您正苦于以下问题:Java CheckboxTableViewer.newCheckList方法的具体用法?Java CheckboxTableViewer.newCheckList怎么用?Java CheckboxTableViewer.newCheckList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jface.viewers.CheckboxTableViewer的用法示例。


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

示例1: createViewer

import org.eclipse.jface.viewers.CheckboxTableViewer; //导入方法依赖的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: createPageControls

import org.eclipse.jface.viewers.CheckboxTableViewer; //导入方法依赖的package包/类
private void createPageControls( Composite parent ) {
  cleanupButton = new Button( parent, SWT.CHECK );
  cleanupButton.setText( "Remove on-the-fly generated launch configurations when no longer needed" );
  cleanupButton.addListener( SWT.Selection, this::cleanupButtonSelected );
  cleanupTypesLabel = new Label( parent, SWT.NONE );
  cleanupTypesLabel.setText( "Select the launch configuration types to clean up" );
  cleanupTypesViewer = CheckboxTableViewer.newCheckList( parent, SWT.BORDER );
  cleanupTypesViewer.setLabelProvider( DebugUITools.newDebugModelPresentation() );
  cleanupTypesViewer.setContentProvider( ArrayContentProvider.getInstance() );
  cleanupTypesViewer.setComparator( new WorkbenchViewerComparator() );
  cleanupTypesViewer.addFilter( new LaunchConfigTypeFilter() );
  cleanupTypesViewer.setInput( launchManager.getLaunchConfigurationTypes() );
  selectAllButton = new Button( parent, SWT.PUSH );
  selectAllButton.addListener( SWT.Selection, event -> cleanupTypesViewer.setAllChecked( true ) );
  selectAllButton.setText( "&Select All" );
  deselectAllButton = new Button( parent, SWT.PUSH );
  deselectAllButton.setText( "&Deselect All" );
  deselectAllButton.addListener( SWT.Selection, event -> cleanupTypesViewer.setAllChecked( false ) );
  notelabel = new Label( parent, SWT.WRAP );
  String text
    = "Note: Launch configurations are considered as on-the-fly generated if "
    + "they were created outside the Run Configurations dialog without further "
    + "manual changes. For example with Run As > JUnit Test";
  notelabel.setText( text );
}
 
开发者ID:rherrmann,项目名称:eclipse-extras,代码行数:26,代码来源:CleanupPreferencePage.java

示例3: createFieldComposite

import org.eclipse.jface.viewers.CheckboxTableViewer; //导入方法依赖的package包/类
private Composite createFieldComposite(final Composite composite) {
    Composite fieldComposite = new Composite(composite, SWT.NONE);
    GridLayout layout = new GridLayout();
    fieldComposite.setLayout(layout);

    fieldViewer = CheckboxTableViewer.newCheckList(fieldComposite, SWT.MULTI | SWT.TOP | SWT.BORDER);
    GridData data = new GridData(GridData.FILL_BOTH);
    data.grabExcessHorizontalSpace = true;

    fieldViewer.getTable().setLayoutData(data);

    fieldViewer.setLabelProvider(new JavaElementLabelProvider());
    fieldViewer.setContentProvider(new ArrayContentProvider());
    fieldViewer.setInput(allFields);
    selectAllNonTransientFields();
    return fieldComposite;
}
 
开发者ID:maximeAudrain,项目名称:jenerate,代码行数:18,代码来源:FieldDialogImpl.java

示例4: CooperateProjectImportComposite

import org.eclipse.jface.viewers.CheckboxTableViewer; //导入方法依赖的package包/类
/**
 * Constructor, creates a CheckboxTableViewer and selection buttons.
 * 
 * @param parent
 *            The parent composite.
 * @param style
 *            Style which will be used.
 * @param page
 *            Page which uses this composite.
 */
public CooperateProjectImportComposite(Composite parent, int style, ImportWizardPage page) {
    super(parent, style);
    Composite tableComposite = new Composite(this, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    layout.marginWidth = 0;
    layout.makeColumnsEqualWidth = false;
    tableComposite.setLayout(layout);

    tableComposite
            .setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.FILL_BOTH));

    tv = CheckboxTableViewer.newCheckList(tableComposite, style | SWT.BORDER);
    GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
    gridData.widthHint = new PixelConverter(tv.getControl()).convertWidthInCharsToPixels(25);
    gridData.heightHint = new PixelConverter(tv.getControl()).convertHeightInCharsToPixels(10);
    tv.getControl().setLayoutData(gridData);
    setLayout(layout);
    tv.addSelectionChangedListener(event -> selectionChanged(page));
    addSelectionButtons(page);
}
 
开发者ID:Cooperate-Project,项目名称:CooperateModelingEnvironment,代码行数:32,代码来源:CooperateProjectImportComposite.java

示例5: 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;
}
 
开发者ID:diverse-project,项目名称:InspectorGuidget,代码行数:19,代码来源:InspectorGuidgetView.java

示例6: createTableViewer

import org.eclipse.jface.viewers.CheckboxTableViewer; //导入方法依赖的package包/类
@Override
protected TableViewer createTableViewer() {
    final CheckboxTableViewer viewer = CheckboxTableViewer.newCheckList(this, SWT.MULTI | SWT.H_SCROLL
        | SWT.V_SCROLL | SWT.BORDER);
    viewer.setCheckStateProvider(checkStateProvider);
    viewer.addCheckStateListener(new ICheckStateListener() {
        @Override
        public void checkStateChanged(CheckStateChangedEvent event) {
            if (((ManifestItem) event.getElement()).isBuiltIn()) {
                viewer.setChecked(event.getElement(), !event.getChecked()); 
            } else {
                ((ManifestItem) event.getElement()).setOptional(!event.getChecked());
                fireDependenciesChangedListener();
            }
        }
    });
    return viewer;
}
 
开发者ID:Talend,项目名称:tesb-studio-se,代码行数:19,代码来源:CheckedCamelDependenciesPanel.java

示例7: createControl

import org.eclipse.jface.viewers.CheckboxTableViewer; //导入方法依赖的package包/类
@Override
public void createControl(Composite parent)
{
	Composite container = new Composite(parent, SWT.NONE);
	container.setLayout(new GridLayout(2, true));
	
	databaseTable = CheckboxTableViewer.newCheckList(container,
			SWT.BORDER | SWT.FULL_SELECTION | SWT.V_SCROLL);
	databaseTable.setContentProvider(new DatabaseTypeContentProvider());
	databaseTable.setLabelProvider(new DatabaseTypeLabelProvider());
	databaseTable.setInput(descriptors);
	databaseTable.addCheckStateListener(this);
	databaseTable.getTable().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 2));

	cmdSelectAll = new Button(container, SWT.NONE);
	cmdSelectAll.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 1, 1));
	cmdSelectAll.setText("Alle auswählen");
	cmdSelectAll.addListener(SWT.Selection, this);
	
	cmdSelectNone = new Button(container, SWT.NONE);
	cmdSelectNone.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 1, 1));
	cmdSelectNone.setText("Alle abwählen");
	cmdSelectNone.addListener(SWT.Selection, this);
	
	setControl(container);
}
 
开发者ID:TheWhiteShadow3,项目名称:cuina,代码行数:27,代码来源:ProjectWizard.java

示例8: createControl

import org.eclipse.jface.viewers.CheckboxTableViewer; //导入方法依赖的package包/类
@Override
public void createControl(Composite parent)
{
	Composite container = new Composite(parent, SWT.NONE);
	container.setLayout(new GridLayout(2, true));

	databaseTable = CheckboxTableViewer.newCheckList(container, SWT.BORDER | SWT.FULL_SELECTION | SWT.V_SCROLL);
	databaseTable.getTable().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 2));
	databaseTable.setContentProvider(new DatabaseTypeContentProvider());
	databaseTable.setLabelProvider(new DatabaseTypeLabelProvider());
	databaseTable.setInput(descriptors);
	
	cmdSelectAll = new Button(container, SWT.NONE);
	cmdSelectAll.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 1, 1));
	cmdSelectAll.setText("Alle auswählen");
	cmdSelectAll.addListener(SWT.Selection, this);

	cmdSelectNone = new Button(container, SWT.NONE);
	cmdSelectNone.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 1, 1));
	cmdSelectNone.setText("Alle abwählen");
	cmdSelectNone.addListener(SWT.Selection, this);

	setControl(container);
}
 
开发者ID:TheWhiteShadow3,项目名称:cuina,代码行数:25,代码来源:DatabaseWizard.java

示例9: createListViewer

import org.eclipse.jface.viewers.CheckboxTableViewer; //导入方法依赖的package包/类
/**
 * Create this group's list viewer.
 */
protected void createListViewer(Composite parent) {
	listViewer = CheckboxTableViewer.newCheckList(parent, SWT.BORDER);
	GridData data = new GridData(GridData.FILL_BOTH);
	data.heightHint = PREFERRED_HEIGHT;
	listViewer.getTable().setLayoutData(data);
	listViewer.getTable().setFont(parent.getFont());
	listViewer.setContentProvider(filesContentProvider);
	listViewer.setLabelProvider(filesLabelProvider);
	listViewer.addCheckStateListener(new ICheckStateListener() {

		@Override
		public void checkStateChanged(CheckStateChangedEvent event) {
			checkListStateChanged(event);
		}
	});
}
 
开发者ID:kelvinst,项目名称:psf-import,代码行数:20,代码来源:PsfImportWizardFilesSelectionPage.java

示例10: createProjectList

import org.eclipse.jface.viewers.CheckboxTableViewer; //导入方法依赖的package包/类
/**
 * Creates the checkbox tree and list for selecting resources.
 *
 * @param parent
 *            the parent control
 */
protected void createProjectList(Composite parent) {

	// create the input element, which has the root resource
	// as its only child
	List<IProject> input = new ArrayList<>();
	IProject[] projects = ResourcesPlugin.getWorkspace().getRoot()
			.getProjects();
	for (int i = 0; i < projects.length; i++) {
		if (projects[i].isOpen()) {
			input.add(projects[i]);
		}
	}

	listViewer = CheckboxTableViewer.newCheckList(parent, SWT.TOP
			| SWT.BORDER);
	GridData data = new GridData(GridData.FILL_BOTH);
	listViewer.getTable().setLayoutData(data);

	listViewer.setLabelProvider(WorkbenchLabelProvider.getDecoratingWorkbenchLabelProvider());
	listViewer.setContentProvider(getContentProvider());
	listViewer.setComparator(new ViewerComparator());

	// check for initial modification to avoid work if no changes are made
	listViewer.addCheckStateListener(new ICheckStateListener() {
		@Override
		public void checkStateChanged(CheckStateChangedEvent event) {
			if (event.getChecked()) {
				for (Object currentlyChecked : listViewer.getCheckedElements()) {
					if (currentlyChecked != event.getElement()) {
						listViewer.setChecked(currentlyChecked, false);
					}
				}
			}
			updateWidgetEnablements();
		}
	});
	listViewer.setInput(workspace);
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:45,代码来源:AbstractExportToSingleFileWizardPage.java

示例11: addUnaddedResourcesArea

import org.eclipse.jface.viewers.CheckboxTableViewer; //导入方法依赖的package包/类
private void addUnaddedResourcesArea(Composite composite) {
	
	// add a description label
	createWrappingLabel(composite, Policy.bind("ReleaseCommentDialog.unaddedResources")); //$NON-NLS-1$

	// add the selectable checkbox list
	listViewer = CheckboxTableViewer.newCheckList(composite, SWT.BORDER);
	GridData data = new GridData(GridData.FILL_BOTH);
	data.heightHint = SELECTION_HEIGHT_HINT;
	data.widthHint = WIDTH_HINT;
	listViewer.getTable().setLayoutData(data);

	// set the contents of the list
	listViewer.setLabelProvider(new WorkbenchLabelProvider() {
		protected String decorateText(String input, Object element) {
			if (element instanceof IResource)
				return ((IResource)element).getFullPath().toString();
			else
				return input;
		}
	});
	listViewer.setContentProvider(new WorkbenchContentProvider());
	listViewer.setInput(new AdaptableResourceList(unaddedResources));
	if (resourcesToAdd == null) {
		listViewer.setAllChecked(true);
	} else {
		listViewer.setCheckedElements(resourcesToAdd);
	}
	listViewer.addSelectionChangedListener(new ISelectionChangedListener() {
		public void selectionChanged(SelectionChangedEvent event) {
			resourcesToAdd = listViewer.getCheckedElements();
		}
	});
	
	addSelectionButtons(composite);
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:37,代码来源:AddToVersionControlDialog.java

示例12: LanguageSelectionTable

import org.eclipse.jface.viewers.CheckboxTableViewer; //导入方法依赖的package包/类
public LanguageSelectionTable(Composite parent, int style) {
		super(parent, style);

//		this.setLayout(new FillLayout());
		this.setLayout(new GridLayout(1, false));
		 
		currentLanguages = new Text(this, SWT.READ_ONLY);
		currentLanguages.setBackground(Colors.getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
		currentLanguages.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
		
		tv =  CheckboxTableViewer.newCheckList(this, SWT.BORDER | SWT.V_SCROLL);
		tv.setContentProvider(new ArrayContentProvider());
		tv.getTable().setHeaderVisible(false);
		GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
		gd.heightHint=80;
		gd.widthHint=150;
		tv.getTable().setLayoutData(gd);

		TableViewerColumn tvc = new TableViewerColumn(tv, SWT.NONE);
		tvc.getColumn().setWidth(gd.widthHint);
		tvc.setLabelProvider(new ColumnLabelProvider() {
			@Override
			public String getText(Object element) {
				return (String) element;
			}
		});
		
		tv.addCheckStateListener(new ICheckStateListener() {
			@Override
			public void checkStateChanged(CheckStateChangedEvent event) {
				updateCurrentLanguageLabel();
			}
		});
	}
 
开发者ID:Transkribus,项目名称:TranskribusSwtGui,代码行数:35,代码来源:LanguageSelectionTable.java

示例13: createListViewer

import org.eclipse.jface.viewers.CheckboxTableViewer; //导入方法依赖的package包/类
protected void createListViewer(Composite parent, int width, int height)
{
    fListViewer = CheckboxTableViewer.newCheckList(parent, 0);
    fListViewer.setUseHashlookup(true);
    GridData data = new GridData(1808);
    data.widthHint = width;
    data.heightHint = height;
    fListViewer.getTable().setLayoutData(data);
    fListViewer.setContentProvider(fListContentProvider);
    fListViewer.setLabelProvider(fListLabelProvider);
    fListViewer.addCheckStateListener(this);
}
 
开发者ID:qxo,项目名称:eclipse-code-lines-plugin,代码行数:13,代码来源:CheckboxTreeAndListGroup.java

示例14: createDialogArea

import org.eclipse.jface.viewers.CheckboxTableViewer; //导入方法依赖的package包/类
/**
 * Create contents of the dialog.
 * @param parent
 */
@Override
protected Control createDialogArea(Composite parent) {
	
	setTitle("Project Filter Selection Dialog");
	setMessage("Please select projects from the list you want to filter in.");
	
	Composite area = (Composite) super.createDialogArea(parent);
	Composite container = new Composite(area, SWT.NONE);
	container.setLayout(new GridLayout(1, false));
	container.setLayoutData(new GridData(GridData.FILL_BOTH));
	
	checkboxTableViewer = CheckboxTableViewer.newCheckList(container, SWT.BORDER | SWT.FULL_SELECTION);
	table = checkboxTableViewer.getTable();
	table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
	
	ComposedAdapterFactory factory = new ComposedAdapterFactory(
			ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
	AdapterFactoryLabelProvider.StyledLabelProvider labelProvider = new AdapterFactoryLabelProvider.StyledLabelProvider(
			factory, checkboxTableViewer);
	AdapterFactoryContentProvider contentProvider = new AdapterFactoryContentProvider(
			factory);

	checkboxTableViewer.setContentProvider(contentProvider);
	checkboxTableViewer.setLabelProvider(new DelegatingStyledCellLabelProvider(
			labelProvider));
	TreeNodeWrapper root = BtsviewmodelFactory.eINSTANCE.createTreeNodeWrapper();
	root.getChildren().addAll(loadNodes(objects));
	checkboxTableViewer.setInput(root);
	
	Composite composite = new Composite(container, SWT.NONE);
	composite.setLayoutData(new GridData(SWT.FILL, SWT.BOTTOM, true, false, 1, 1));

	for (TreeNodeWrapper p : checkedTreeNodes)
	{
		checkboxTableViewer.setChecked(p, true);
	}
	return area;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:43,代码来源:ObjectByListEntrySelectionFilterDialog.java

示例15: createProductsContent

import org.eclipse.jface.viewers.CheckboxTableViewer; //导入方法依赖的package包/类
/**
 * Creates the product list area.
 * 
 * @param parent Parent
 * @return Product list area
 */
public Control createProductsContent(Composite parent) {
	Composite area = new Composite(parent, SWT.NONE);
	area.setLayout(new GridLayout(1, false));
	area.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

	// Message label
	messageLabel = new Label(area, SWT.WRAP);
	messageLabel.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false, 1, 1));
	messageLabel.setText(getPromptMessage());
	
	viewer = CheckboxTableViewer.newCheckList(area, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.BORDER);
	viewer.getTable().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
	viewer.getTable().setHeaderVisible(true);
	viewer.setLabelProvider(new ProductLabelProvider());
	// Components table columns
	for (int i = 0; i < COLUMN_NAMES.length; i++) {
		TableColumn column = new TableColumn(viewer.getTable(), SWT.LEFT);
		column.setText(COLUMN_NAMES[i]);
		column.setWidth(COLUMN_WIDTHS[i]);
	}
	viewer.setContentProvider(new ArrayContentProvider());
	viewer.addSelectionChangedListener(new ISelectionChangedListener() {
		@Override
		public void selectionChanged(SelectionChangedEvent event) {
			onProductSelected();
		}
	});
	
	return area;
}
 
开发者ID:MentorEmbedded,项目名称:p2-installer,代码行数:37,代码来源:ProductsPage.java


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