本文整理汇总了Java中org.eclipse.jface.viewers.CheckStateChangedEvent.getElement方法的典型用法代码示例。如果您正苦于以下问题:Java CheckStateChangedEvent.getElement方法的具体用法?Java CheckStateChangedEvent.getElement怎么用?Java CheckStateChangedEvent.getElement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jface.viewers.CheckStateChangedEvent
的用法示例。
在下文中一共展示了CheckStateChangedEvent.getElement方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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());
}
}
}
示例2: 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();
}
}
示例3: 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());
}
}
示例4: 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();
}
示例5: 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();
}
示例6: 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);
}
}
示例7: checkStateChanged
import org.eclipse.jface.viewers.CheckStateChangedEvent; //导入方法依赖的package包/类
@Override
public void checkStateChanged(CheckStateChangedEvent event) {
// check/uncheck element
if (event.getElement() != null) {
DeploymentComponent deploymentComponent = (DeploymentComponent) event.getElement();
deploymentComponent.setDeploy(event.getChecked());
DeploymentComponentSet components = page.getController().getDeploymentPayload().getDeploymentComponents();
for (DeploymentComponent component : components) {
if (component.getComponent().getName().equals(deploymentComponent.getComponent().getName())
&& component.getComponent().isMetadataInstance()) {
component.setDeploy(event.getChecked());
}
}
}
page.setEnableButton();
}
示例8: checkStateChanged
import org.eclipse.jface.viewers.CheckStateChangedEvent; //导入方法依赖的package包/类
@Override
public void checkStateChanged(CheckStateChangedEvent event) {
Object element = event.getElement();
if (element instanceof ASTRuleDescriptor) {
ASTRuleDescriptor descriptor = (ASTRuleDescriptor) element;
// If element is mandatory, it should always remain checked !
if (descriptor.isMandatory()) {
event.getCheckable().setChecked(event.getElement(), true);
return;
}
// Now, if not mandatory, we save the state.
if (states.containsKey(descriptor))
states.remove(descriptor);
states.put(descriptor, !event.getChecked());
}
}
示例9: rememberLeafCheckState
import org.eclipse.jface.viewers.CheckStateChangedEvent; //导入方法依赖的package包/类
private void rememberLeafCheckState(CheckStateChangedEvent event){
Object[] checked = laborViewer.getCheckedElements();
if (checkState == null) {
checkState = new ArrayList<GroupItem>(checked.length);
}
for (int i = 0; i < checked.length; i++) {
if (!laborViewer.getGrayed(checked[i])) {
if (!checkState.contains(checked[i])) {
if (checked[i] instanceof GroupItem) {
checkState.add((GroupItem) checked[i]);
} else
if ((checked[i] instanceof Group) && (event.getElement() == checked[i])) {
checkState.addAll(((Group) checked[i]).items);
}
}
}
}
}
示例10: checkStateChanged
import org.eclipse.jface.viewers.CheckStateChangedEvent; //导入方法依赖的package包/类
public void checkStateChanged(CheckStateChangedEvent event)
{
boolean checkState = event.getChecked();
Object checkedObject = event.getElement();
// only handle the check event if the Ecore model can have edits with its current mapping set
if ((checkedObject instanceof Vector<?>) && (canEditEcoreModel()))
{
String key = rowKey((Vector<?>)checkedObject);
EStructuralFeature feature = features.get(key);
handleCheckEvent(feature,checkState,selectedLabelledClass);
checkedFeatures.put(key, new Boolean(checkState));
// show the results again, and make sure the checked row is visible
showResultAgain(checkedObject);
}
}
示例11: handleCheckStateChange
import org.eclipse.jface.viewers.CheckStateChangedEvent; //导入方法依赖的package包/类
/** recompute page completion upon check-changes. */
protected void handleCheckStateChange(CheckStateChangedEvent event) {
// Update the selection map accordingly
Object changedElement = event.getElement();
if (changedElement instanceof IProject) {
projects.put((IProject) changedElement, event.getChecked());
}
updatePageCompletion();
}
示例12: checkStateChanged
import org.eclipse.jface.viewers.CheckStateChangedEvent; //导入方法依赖的package包/类
@Override
public void checkStateChanged(final CheckStateChangedEvent event) {
final boolean checked = event.getChecked();
final Object element = event.getElement();
if (checked) {
elements.add(element);
onCheck(element);
} else {
elements.remove(element);
onUncheck(element);
}
}
示例13: checkStateChanged
import org.eclipse.jface.viewers.CheckStateChangedEvent; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public void checkStateChanged(final CheckStateChangedEvent event) {
// If the item is checked . . .
update(event.getElement(), null);
if (event.getElement() instanceof PreferenceRule) {
ruleChecked(event, (PreferenceRule) event.getElement());
} else if (event.getElement() instanceof PreferenceCategory) {
categoryChecked(event, (PreferenceCategory) event.getElement());
}
}
示例14: forceExistingChecked
import org.eclipse.jface.viewers.CheckStateChangedEvent; //导入方法依赖的package包/类
protected void forceExistingChecked(CheckStateChangedEvent event) {
if (fExisting != null) {
Object elem= event.getElement();
if (fExisting.contains(elem)) {
fViewer.setChecked(elem, true);
}
}
}
示例15: checkStateChanged
import org.eclipse.jface.viewers.CheckStateChangedEvent; //导入方法依赖的package包/类
@Override
public void checkStateChanged(CheckStateChangedEvent event) {
Optional<Document> activeDocument = ModelRegistryPlugin.getModelRegistry().getActiveDocument();
if (activeDocument.isPresent()) {
Document document = activeDocument.get();
Command changeCommand = new ExecuteCommand() {
@Override
public void execute() {
final Term element = (Term) event.getElement();
setTermChanged(document, element, event.getChecked());
}
};
executeCommand(changeCommand);
}
}