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


Java ICheckStateListener类代码示例

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


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

示例1: createViewer

import org.eclipse.jface.viewers.ICheckStateListener; //导入依赖的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: createTreeViewer

import org.eclipse.jface.viewers.ICheckStateListener; //导入依赖的package包/类
@Override
protected CheckboxTreeViewer createTreeViewer(Composite parent) {
  int style = SWT.VIRTUAL | SWT.FULL_SELECTION | SWT.BORDER
      | SWT.H_SCROLL | SWT.V_SCROLL;
  CheckboxTreeViewer result = new CheckboxTreeViewer(parent, style);
  result.setLabelProvider(new WorkbenchLabelProvider());
  result.setContentProvider(new BaseWorkbenchContentProvider());
  result.setComparator(new NodeWrapperTreeSorter());

  result.addCheckStateListener(new ICheckStateListener() {
    @Override
    public void checkStateChanged(CheckStateChangedEvent event) {
      if (recursiveTreeSelect) {
        tree.setSubtreeChecked(event.getElement(), event.getChecked());
      }
    }
  });

  tree = result;
  return result;
}
 
开发者ID:google,项目名称:depan,代码行数:22,代码来源:CheckNodeTreeView.java

示例3: createTreeViewer

import org.eclipse.jface.viewers.ICheckStateListener; //导入依赖的package包/类
/**
 * Creates the tree viewer.
 *
 * @param parent the parent composite
 * @return the tree viewer
 */
protected CheckboxTreeViewer createTreeViewer(Composite parent) {
    fViewer = new CheckboxTreeViewer(parent, SWT.BORDER);

    fViewer.setContentProvider(fContentProvider);
    fViewer.setLabelProvider(fLabelProvider);
    fViewer.addCheckStateListener(new ICheckStateListener() {
        @Override
        public void checkStateChanged(CheckStateChangedEvent event) {
            updateOKStatus();
        }
    });

    fViewer.setComparator(new ResourceComparator(ResourceComparator.NAME));
    if (fFilters != null) {
        for (int i = 0; i != fFilters.size(); i++) {
            fViewer.addFilter((ViewerFilter) fFilters.get(i));
        }
    }

    fViewer.setInput(fInput);

    return fViewer;
}
 
开发者ID:iloveeclipse,项目名称:filesync4eclipse,代码行数:30,代码来源:MultipleFolderSelectionDialog.java

示例4: createTreeViewer

import org.eclipse.jface.viewers.ICheckStateListener; //导入依赖的package包/类
/**
 * Creates the tree viewer.
 *
 * @param parent the parent composite
 * @return the tree viewer
 */
protected CheckboxTreeViewer createTreeViewer(Composite parent) {
	fViewer = new CheckboxTreeViewer(parent, SWT.BORDER);

	fViewer.setContentProvider(fContentProvider);
	fViewer.setLabelProvider(fLabelProvider);
	fViewer.addCheckStateListener(new ICheckStateListener() {
		public void checkStateChanged(CheckStateChangedEvent event) {
			updateOKStatus();
		}
	});

	fViewer.setComparator(new ResourceComparator(ResourceComparator.NAME));
	if (fFilters != null) {
		for (int i = 0; i != fFilters.size(); i++)
			fViewer.addFilter(fFilters.get(i));
	}

	fViewer.setInput(fInput);

	return fViewer;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:28,代码来源:MultipleFolderSelectionDialog.java

示例5: createResourcesGroup

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

	// create the input element, which has the root resource
	// as its only child
	List 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]);
		}
	}

	this.resourceGroup = new ResourceTreeAndListGroup(parent, input, getResourceProvider(IResource.FOLDER
			| IResource.PROJECT), WorkbenchLabelProvider.getDecoratingWorkbenchLabelProvider(),
			getResourceProvider(IResource.FILE), WorkbenchLabelProvider.getDecoratingWorkbenchLabelProvider(),
			SWT.NONE, DialogUtil.inRegularFontMode(parent));

	ICheckStateListener listener = new ICheckStateListener() {
		public void checkStateChanged(CheckStateChangedEvent event) {
			updateWidgetEnablements();
		}
	};

	this.resourceGroup.addCheckStateListener(listener);
}
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:31,代码来源:WizardExportResourcesPage2.java

示例6: createTableViewer

import org.eclipse.jface.viewers.ICheckStateListener; //导入依赖的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: createDialogArea

import org.eclipse.jface.viewers.ICheckStateListener; //导入依赖的package包/类
@Override
protected Control createDialogArea(Composite parent) {
	Composite container = (Composite) super.createDialogArea(parent);
	parent.getShell().setText(Messages.FilesChangedListDialog_CommitChanges);

	container = createDialogAreaUtil(container);
	setTitle(Messages.FilesChangedListDialog_CommitChanges);
	setMessage(Messages.FilesChangedListDialog_CommitMessage, IMessageProvider.INFORMATION); //$NON-NLS-1$

	filesViewer.addCheckStateListener(new ICheckStateListener() {

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

	updateFileSectionText();
	return container;
}
 
开发者ID:SEMERU-WM,项目名称:ChangeScribe,代码行数:20,代码来源:DescribeVersionsDialog.java

示例8: PathsProvider

import org.eclipse.jface.viewers.ICheckStateListener; //导入依赖的package包/类
protected PathsProvider(TableViewer viewer, FindbugsPropertyPage propertyPage) {
        this.propertyPage = propertyPage;
        this.paths = new ArrayList<IPathElement>();
        this.viewer = viewer;
        if(viewer instanceof CheckboxTableViewer) {
            CheckboxTableViewer tv = (CheckboxTableViewer) viewer;
//            tv.setCheckStateProvider(this);
            tv.addCheckStateListener(new ICheckStateListener() {
                public void checkStateChanged(CheckStateChangedEvent event) {
                    boolean checked = event.getChecked();
                    IPathElement element = (IPathElement) event.getElement();
                    element.setEnabled(checked);
                    handleContendChanged();
                }
            });
        }
        this.control = viewer.getTable();
        listeners = new ListenerList();
        viewer.setContentProvider(this);
    }
 
开发者ID:OpenNTF,项目名称:FindBug-for-Domino-Designer,代码行数:21,代码来源:PathsProvider.java

示例9: createTreeViewer

import org.eclipse.jface.viewers.ICheckStateListener; //导入依赖的package包/类
private void createTreeViewer(Composite treeComp) {
    treeViewer = new ContainerCheckedTreeViewer(treeComp);
    treeViewer.addCheckStateListener(new ICheckStateListener() {
        @Override
        public void checkStateChanged(CheckStateChangedEvent event) {
            processSelectionChange();
        }
    });

    treeViewer.setContentProvider(classProvider);
    treeViewer.setLabelProvider(labelProvider);
    treeViewer.setAutoExpandLevel(2);
    // treeViewer.addFilter(new MethodViewerFilter());
    treeViewer.setUseHashlookup(true);
    treeViewer.setInput("");
    treeViewer.setSelection(new StructuredSelection(treeViewer.getExpandedElements()[0]));
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:18,代码来源:OverrideMethodsPage.java

示例10: createTreeViewer

import org.eclipse.jface.viewers.ICheckStateListener; //导入依赖的package包/类
private void createTreeViewer(Composite treeComp) {
    treeViewer = new ContainerCheckedTreeViewer(treeComp);
    treeViewer.addCheckStateListener(new ICheckStateListener() {
        @Override
        public void checkStateChanged(CheckStateChangedEvent event) {
            getRequestProcsseor().setCheckedElements(treeViewer.getCheckedElements());
            GeneratePropertiesPage.this.getWizard().getContainer().updateButtons();
        }
    });

    treeViewer.setContentProvider(classProvider);
    treeViewer.setLabelProvider(labelProvider);
    treeViewer.setAutoExpandLevel(2);
    treeViewer.setInput("");
    treeViewer.setSelection(new StructuredSelection(treeViewer.getExpandedElements()[0]));
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:17,代码来源:GeneratePropertiesPage.java

示例11: createTreeViewer

import org.eclipse.jface.viewers.ICheckStateListener; //导入依赖的package包/类
private void createTreeViewer(Composite treeComp) {
    treeViewer = new ContainerCheckedTreeViewer(treeComp);
    treeViewer.addCheckStateListener(new ICheckStateListener() {
        @Override
        public void checkStateChanged(CheckStateChangedEvent event) {
            getRequestProcessor().setCheckedElements(treeViewer.getCheckedElements());
            ConstructorFieldPage.this.getWizard().getContainer().updateButtons();
        }
    });

    treeViewer.setContentProvider(classProvider);
    treeViewer.setLabelProvider(labelProvider);
    treeViewer.setAutoExpandLevel(2);
    treeViewer.setInput("");
    treeViewer.setSelection(new StructuredSelection(treeViewer.getExpandedElements()[0]));
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:17,代码来源:ConstructorFieldPage.java

示例12: createListViewer

import org.eclipse.jface.viewers.ICheckStateListener; //导入依赖的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

示例13: createFileSelectionGroup

import org.eclipse.jface.viewers.ICheckStateListener; //导入依赖的package包/类
/**
 * Create the import source selection widget
 */
protected void createFileSelectionGroup(Composite parent) {
	root = new FileElement("Dummy", null, true);
	this.foldersContentProvider = new FolderContentProvider(fileStructureProvider);
	this.filesContentProvider = new FileContentProvider(fileStructureProvider);
	this.folderLabelProvider = new WorkbenchLabelProvider();
	this.filesLabelProvider = new WorkbenchLabelProvider();

	createContents(parent, SWT.NONE);

	ICheckStateListener listener = new ICheckStateListener() {
		public void checkStateChanged(CheckStateChangedEvent event) {
			updateWidgetEnablements();
		}
	};

	WorkbenchViewerComparator comparator = new WorkbenchViewerComparator();
	setTreeComparator(comparator);
	setListComparator(comparator);
	addCheckStateListener(listener);

}
 
开发者ID:kelvinst,项目名称:psf-import,代码行数:25,代码来源:PsfImportWizardFilesSelectionPage.java

示例14: createPartControl

import org.eclipse.jface.viewers.ICheckStateListener; //导入依赖的package包/类
/**
 * Callback to create the viewer and initialize it.
 */
public void createPartControl(Composite parent) {
	table = new Table(parent, SWT.CHECK | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION );
	viewer = new CheckboxTableViewer(table);
	ICheckStateListener listener = new CheckStateListener();
	viewer.addCheckStateListener(listener);
	table.setHeaderVisible(true);
	table.setLinesVisible(true);
	qrSorter = new RowSorter(viewer, this);
	viewer.setSorter(qrSorter);
	String[] properties = setColumnHeaders();

	// define a property name for each column (which is the column header)
	viewer.setColumnProperties(properties);
	// define the cell editors for each column (only the business name and value column editors work)
	editors = editors(table, properties.length);
	viewer.setCellEditors(editors);
	// define how the editors get and change the values shown in the cells
	viewer.setCellModifier(new CellModifier());

	// make the actions that will be items on the menu of this view
	makeActions();

	// attach the menu to this view
	contributeToActionBars();
}
 
开发者ID:openmapsoftware,项目名称:mappingtools,代码行数:29,代码来源:FeatureView.java

示例15: createProjectList

import org.eclipse.jface.viewers.ICheckStateListener; //导入依赖的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


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