本文整理汇总了Java中org.eclipse.jface.viewers.CheckStateChangedEvent类的典型用法代码示例。如果您正苦于以下问题:Java CheckStateChangedEvent类的具体用法?Java CheckStateChangedEvent怎么用?Java CheckStateChangedEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CheckStateChangedEvent类属于org.eclipse.jface.viewers包,在下文中一共展示了CheckStateChangedEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createViewer
import org.eclipse.jface.viewers.CheckStateChangedEvent; //导入依赖的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: checkStateChanged
import org.eclipse.jface.viewers.CheckStateChangedEvent; //导入依赖的package包/类
@Override
public void checkStateChanged(CheckStateChangedEvent event) {
boolean showWarning = false;
for (TreeElement el : depcyElementsSet) {
if (!el.isSelected()) {
switch (el.getSide()) {
// удаляется
case LEFT:
showWarning = hasSelectedParent(el);
break;
// создается
case RIGHT:
showWarning = el.isSubTreeSelected();
break;
default:
break;
}
if (showWarning) {
break;
}
}
}
warningLbl.setVisible(showWarning);
getButton(OK).setEnabled(!showWarning);
}
示例3: checkboxTreeViewerCheckStateChanged
import org.eclipse.jface.viewers.CheckStateChangedEvent; //导入依赖的package包/类
private void checkboxTreeViewerCheckStateChanged(CheckStateChangedEvent event) {
CheckboxTreeViewer viewer = (CheckboxTreeViewer) event.getSource();
TableTreeNode node = (TableTreeNode) event.getElement();
if (event.getChecked()) {
viewer.setSubtreeChecked(node, true);
} else {
viewer.setSubtreeChecked(node, false);
if (node.getParent() != null) {
viewer.setChecked(node.getParent(), false);
}
}
Object[] elements = viewer.getCheckedElements();
setPageComplete(elements.length > 0 ? true : false);
checkedTables.clear();
TableTreeNode tableTreeNode;
for (Object obj : elements) {
tableTreeNode = (TableTreeNode) obj;
if (tableTreeNode.isTable) {
checkedTables.add(tableTreeNode.getName());
} else {
dbDriverMetaData.setDbSchema(tableTreeNode.getName());
}
}
}
示例4: checkStateChanged
import org.eclipse.jface.viewers.CheckStateChangedEvent; //导入依赖的package包/类
@Override
public void checkStateChanged(final CheckStateChangedEvent event) {
try {
final Object eventElement = event.getElement();
if (eventElement instanceof ImportEclipseProject) {
final ImportEclipseProject project = (ImportEclipseProject) eventElement;
if (!canImport(project)) {
treeViewer.setChecked(project, false);
}
project.setSelected(treeViewer.getChecked(project));
treeViewer.refresh(project);
}
} catch (final Exception e) {
logger.error(e.getMessage(), e);
} finally {
handleProjectSelection();
}
}
示例5: checkStateChanged
import org.eclipse.jface.viewers.CheckStateChangedEvent; //导入依赖的package包/类
public void checkStateChanged(final CheckStateChangedEvent event)
{
BusyIndicator.showWhile(fTreeViewer.getControl().getDisplay(), new Runnable() {
public void run()
{
if(event.getCheckable().equals(fTreeViewer))
treeItemChecked(event.getElement(), event.getChecked());
else
listItemChecked(event.getElement(), event.getChecked(), true);
notifyCheckStateChangeListeners(event);
}
}
);
}
示例6: doubleClick
import org.eclipse.jface.viewers.CheckStateChangedEvent; //导入依赖的package包/类
public void doubleClick(DoubleClickEvent event) {
IStructuredSelection selection = (IStructuredSelection) event
.getSelection();
Object firstElement = selection.getFirstElement();
if (treeViewer.isExpandable(firstElement)) {
boolean expanded = treeViewer.getExpandedState(firstElement);
treeViewer.setExpandedState(firstElement, !expanded);
} else {
// FIXME :: does not trigger validation
boolean newState = !treeViewer.getChecked(firstElement);
treeViewer.setChecked(firstElement, newState);
if (checkStateListener != null) {
checkStateListener
.checkStateChanged(new CheckStateChangedEvent(
treeViewer, firstElement, newState));
}
}
}
示例7: checkStateChanged
import org.eclipse.jface.viewers.CheckStateChangedEvent; //导入依赖的package包/类
public void checkStateChanged(CheckStateChangedEvent event) {
Object element = event.getElement();
// in case of changed category, go to all problems
if (element instanceof String) {
ITreeContentProvider contentProvider = (ITreeContentProvider)getTreeViewer().getContentProvider();
Object[] problems = contentProvider.getChildren(element);
for (Object problem : problems) {
if (problem instanceof Problem) {
((Problem)problem).setEnabled(event.getChecked());
}
}
}
if (element instanceof Problem) {
((Problem) element).setEnabled(event.getChecked());
}
}
示例8: dialogCheckChanged
import org.eclipse.jface.viewers.CheckStateChangedEvent; //导入依赖的package包/类
private void dialogCheckChanged(CheckStateChangedEvent event) {
FJTree element = (FJTree) event.getElement();
if (element != null) {
boolean checked = event.getChecked();
if (!checked && (element.getCheckState() == FJTree.CS_GRAYED)) {
fileTree.setGrayed(element, false);
fileTree.setChecked(element, true);
checked = true;
}
if ((checked && (element.getCheckState() != FJTree.CS_CHECKED))
|| (!checked && (element.getCheckState() != FJTree.CS_UNCHECKED))) {
element.setChecked(checked);
recursiveCheckChildren(element, checked);
recursiveGrayParents(element);
}
}
dialogChanged();
}
示例9: dialogCheckChanged
import org.eclipse.jface.viewers.CheckStateChangedEvent; //导入依赖的package包/类
private void dialogCheckChanged(CheckStateChangedEvent event) {
FJTree element = (FJTree)event.getElement();
if (element != null) {
boolean checked = event.getChecked();
if (!checked && (element.getCheckState() == FJTree.CS_GRAYED)) {
fileTree.setGrayed(element, false);
fileTree.setChecked(element, true);
checked = true;
}
if ( ( checked && (element.getCheckState() != FJTree.CS_CHECKED)) ||
(!checked && (element.getCheckState() != FJTree.CS_UNCHECKED))){
element.setChecked(checked);
recursiveCheckChildren(element, checked);
recursiveGrayParents(element);
}
}
dialogChanged();
}
示例10: createTreeViewer
import org.eclipse.jface.viewers.CheckStateChangedEvent; //导入依赖的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;
}
示例11: createTreeViewer
import org.eclipse.jface.viewers.CheckStateChangedEvent; //导入依赖的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;
}
示例12: checkStateChanged
import org.eclipse.jface.viewers.CheckStateChangedEvent; //导入依赖的package包/类
@Override
public void checkStateChanged(CheckStateChangedEvent event) {
DetailTreeItem item = (DetailTreeItem)event.getElement();
IInstallComponent component = (IInstallComponent)item.getData();
if (component.isOptional()) {
// Updated install state
component.setInstall(item.isChecked());
// Update install space for new component selection
updateInstallPlan();
// Update button state
updateButtons();
// Validate selection
validateSelection(item);
}
}
示例13: createTreeViewer
import org.eclipse.jface.viewers.CheckStateChangedEvent; //导入依赖的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
示例14: createResourcesGroup
import org.eclipse.jface.viewers.CheckStateChangedEvent; //导入依赖的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);
}
示例15: createTableViewer
import org.eclipse.jface.viewers.CheckStateChangedEvent; //导入依赖的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;
}