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


Java CheckStateChangedEvent类代码示例

本文整理汇总了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();
}
 
开发者ID:Quanticol,项目名称:CARMA,代码行数:21,代码来源:SimulationWizard.java

示例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);
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:26,代码来源:CommitDialog.java

示例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());
		}
	}
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:26,代码来源:ImportFromDatabaseWizardPage.java

示例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();
    }
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:21,代码来源:GitImportWizardSelectProjectsPage.java

示例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);
            }

        }
);
    }
 
开发者ID:qxo,项目名称:eclipse-code-lines-plugin,代码行数:17,代码来源:CheckboxTreeAndListGroup.java

示例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));
		}
	}
}
 
开发者ID:Yakindu,项目名称:statecharts,代码行数:19,代码来源:TreeExpandingDoubleClickListener.java

示例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());
	}

}
 
开发者ID:kwin,项目名称:cppcheclipse,代码行数:19,代码来源:ProblemsTreeEditor.java

示例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();
	}
 
开发者ID:thahn0720,项目名称:agui_eclipse_plugin,代码行数:20,代码来源:FJExportWizardFilesSelectPage.java

示例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();
    }
 
开发者ID:thahn0720,项目名称:agui_eclipse_plugin,代码行数:20,代码来源:FilesSelectPage.java

示例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;
}
 
开发者ID:google,项目名称:depan,代码行数:22,代码来源:CheckNodeTreeView.java

示例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;
}
 
开发者ID:iloveeclipse,项目名称:filesync4eclipse,代码行数:30,代码来源:MultipleFolderSelectionDialog.java

示例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);
	}
}
 
开发者ID:MentorEmbedded,项目名称:p2-installer,代码行数:17,代码来源:ComponentsPage.java

示例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);
}
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:31,代码来源:WizardExportResourcesPage2.java

示例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;
}
 
开发者ID:Talend,项目名称:tesb-studio-se,代码行数:19,代码来源:CheckedCamelDependenciesPanel.java


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