當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。