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


Java CheckStateChangedEvent.getElement方法代码示例

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

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

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

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

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

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

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

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

示例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());
	}
}
 
开发者ID:awltech,项目名称:eclipse-ast-refactor,代码行数:19,代码来源:RulesCheckListener.java

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

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

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

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

示例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());
  }
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:13,代码来源:ValidPreferenceCheckedTreeViewer.java

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

示例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);
	}
}
 
开发者ID:sebastiangoetz,项目名称:slr-toolkit,代码行数:16,代码来源:TaxonomyCheckboxListView.java


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