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


Java CheckStateChangedEvent.getChecked方法代码示例

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

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

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

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

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

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

示例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();
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:34,代码来源:ProjectNaturesPage.java

示例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();
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:33,代码来源:WizardFolderImportPage.java

示例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();
	}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:14,代码来源:WizardPage_20_ReferenceTour.java

示例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();
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:11,代码来源:CheckedListDialogField.java

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

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

示例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();
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:9,代码来源:CheckedListDialogField.java

示例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();
}
 
开发者ID:OpenNTF,项目名称:FindBug-for-Domino-Designer,代码行数:8,代码来源:FilterBugsDialog.java

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


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