本文整理汇总了Java中org.eclipse.jface.viewers.CheckStateChangedEvent.getChecked方法的典型用法代码示例。如果您正苦于以下问题:Java CheckStateChangedEvent.getChecked方法的具体用法?Java CheckStateChangedEvent.getChecked怎么用?Java CheckStateChangedEvent.getChecked使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jface.viewers.CheckStateChangedEvent
的用法示例。
在下文中一共展示了CheckStateChangedEvent.getChecked方法的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: 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();
}
示例3: 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();
}
示例4: checkStateChanged
import org.eclipse.jface.viewers.CheckStateChangedEvent; //导入方法依赖的package包/类
@Override
public void checkStateChanged(CheckStateChangedEvent e)
{
if (update) return;
update = true;
String pluginName = ((CuinaPlugin) e.getElement()).getName();
if (e.getChecked())
plugins.add(pluginName);
else
plugins.remove(pluginName);
cuinaTab.updateTab();
update = false;
}
示例5: 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);
}
}
示例6: 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);
}
}
示例7: checkStateChanged
import org.eclipse.jface.viewers.CheckStateChangedEvent; //导入方法依赖的package包/类
public void checkStateChanged(CheckStateChangedEvent event)
{
// Check if the current checked items are the same as the initial ones.
Object[] checkedElements = fTableViewer.getCheckedElements();
fNaturesModified = !Arrays.equals(fInitialCheckedItems, checkedElements);
if (fPrimaryNature == null)
{
// in case that the item was checked, set it as the primary
if (event.getChecked())
{
updatePrimaryNature(event.getElement().toString());
fTableViewer.refresh();
}
}
else
{
if (!event.getChecked() && isPrimary(event.getElement()))
{
// find the next available item which is checked and set it to
// the primary
if (checkedElements.length == 0)
{
updatePrimaryNature(null);
}
else
{
updatePrimaryNature(checkedElements[0].toString());
}
fTableViewer.refresh();
}
}
updateButtons();
}
示例8: checkStateChanged
import org.eclipse.jface.viewers.CheckStateChangedEvent; //导入方法依赖的package包/类
public void checkStateChanged(CheckStateChangedEvent event)
{
// Check if the current checked items are the same as the initial ones.
Object[] checkedElements = fTableViewer.getCheckedElements();
if (fPrimaryNature == null)
{
// in case that the item was checked, set it as the primary
if (event.getChecked())
{
updatePrimaryNature(event.getElement().toString());
fTableViewer.refresh();
}
}
else
{
if (!event.getChecked() && isPrimary(event.getElement()))
{
// find the next available item which is checked and set it to
// the primary
if (checkedElements.length == 0)
{
updatePrimaryNature(null);
}
else
{
updatePrimaryNature(checkedElements[0].toString());
}
fTableViewer.refresh();
}
}
updateButtons();
}
示例9: onCheckRefTour
import org.eclipse.jface.viewers.CheckStateChangedEvent; //导入方法依赖的package包/类
private void onCheckRefTour(final CheckStateChangedEvent event) {
/*
* Select checked ref tour
*/
if (event.getChecked()) {
final Object checkedElement = event.getElement();
_refTourViewer.setSelection(new StructuredSelection(checkedElement));
}
validatePage();
}
示例10: doCheckStateChanged
import org.eclipse.jface.viewers.CheckStateChangedEvent; //导入方法依赖的package包/类
private void doCheckStateChanged(CheckStateChangedEvent e) {
if (e.getChecked()) {
@SuppressWarnings("unchecked")
E element= (E) e.getElement();
fCheckedElements.add(element);
} else {
fCheckedElements.remove(e.getElement());
}
checkStateChanged();
}
示例11: checkStateChanged
import org.eclipse.jface.viewers.CheckStateChangedEvent; //导入方法依赖的package包/类
/**
* (non-Javadoc)
* @see org.eclipse.jface.viewers.ICheckStateListener#checkStateChanged(org.eclipse.jface.viewers.CheckStateChangedEvent)
*/
@Override
public void checkStateChanged(CheckStateChangedEvent event) {
Object element = event.getElement();
if (element instanceof SearchEntry) {
SearchEntry searchEntry = (SearchEntry) element;
if (searchEntry.isChecked() != event.getChecked()) {
searchEntry.setChecked(event.getChecked());
setDirty(true);
}
}
}
示例12: checkStateChanged
import org.eclipse.jface.viewers.CheckStateChangedEvent; //导入方法依赖的package包/类
@Override
public void checkStateChanged(CheckStateChangedEvent event) {
DeploymentComponent selectedDeploymentComponent = (DeploymentComponent) event.getElement();
if (selectedDeploymentComponent == null || deploymentPayload == null) {
return;
}
// select associated/dependent components too
Component component = selectedDeploymentComponent.getComponent();
if (component != null && component.isWithinFolder()) {
if (!event.getChecked()
&& selectedDeploymentComponent.getDestinationSummary().equals(DeploymentSummary.DELETED)) {
handleUnCheckedSubFolderComponent(selectedDeploymentComponent);
} else if (event.getChecked()
&& selectedDeploymentComponent.getDestinationSummary().equals(DeploymentSummary.NEW)) {
handleCheckedSubFolderComponent(selectedDeploymentComponent);
}
} else if (component != null && Constants.FOLDER.equals(component.getComponentType())) {
if (!event.getChecked()) {
if (selectedDeploymentComponent.getDestinationSummary().equals(DeploymentSummary.NEW)) {
handleUncheckedFolderComponent(selectedDeploymentComponent);
}
} else if (event.getChecked()
&& selectedDeploymentComponent.getDestinationSummary().equals(DeploymentSummary.DELETED)) {
handleCheckedFolderComponent(selectedDeploymentComponent);
}
}
}
示例13: doCheckStateChanged
import org.eclipse.jface.viewers.CheckStateChangedEvent; //导入方法依赖的package包/类
private void doCheckStateChanged(CheckStateChangedEvent e) {
if (e.getChecked()) {
fCheckedElements.add((E) e.getElement());
} else {
fCheckedElements.remove(e.getElement());
}
checkStateChanged();
}
示例14: checkStateChanged
import org.eclipse.jface.viewers.CheckStateChangedEvent; //导入方法依赖的package包/类
public void checkStateChanged(CheckStateChangedEvent event) {
Object element = event.getElement();
boolean checked = event.getChecked();
elementChecked(element, checked);
updateTextIds();
}
示例15: onCheckStateChanged
import org.eclipse.jface.viewers.CheckStateChangedEvent; //导入方法依赖的package包/类
/**
* Called when a {@link CheckStateChangedEvent} occurs on the
* {@link CheckboxTableViewer} backing this {@link TableControl}.
*
* @param event
* the {@link CheckStateChangedEvent}
*/
protected void onCheckStateChanged(final CheckStateChangedEvent event) {
final boolean checked = event.getChecked();
if (isChecksAffectSelection()) {
/*
* propagate checked state to all elements in the current selection
*/
viewer.getTable().setRedraw(false);
final IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
if (selection.size() == viewer.getTable().getItemCount()) {
((CheckboxTableViewer) viewer).setAllChecked(checked);
} else {
/*
* Make sure the element being checked is part of the selection.
* Otherwise, we ignore the selected elements. Avoids the case
* where you have some elements selected, and check a
* non-selected element. The checkstate of the selected elements
* should NOT change in this case.
*/
boolean checkedElementInSelection = false;
for (final Iterator it = selection.iterator(); it.hasNext();) {
if (it.next().equals(event.getElement())) {
checkedElementInSelection = true;
break;
}
}
if (checkedElementInSelection) {
for (final Iterator it = selection.iterator(); it.hasNext();) {
((CheckboxTableViewer) viewer).setChecked(it.next(), checked);
}
}
}
viewer.getTable().setRedraw(true);
}
computeCheckedElements(true);
final Object element = event.getElement();
if (!hideElementFromCollections(element)) {
notifyCheckStateListeners(element, event.getChecked());
}
}