Package org.eclipse.jface.viewers

Examples of org.eclipse.jface.viewers.TreeSelection$InitializeData


        schemaSectionItemDelete.addSelectionListener(new SelectionListener() {
           
            public void widgetSelected(SelectionEvent e) {
                ISelection selection = _treeViewer.getSelection();
                if (selection instanceof TreeSelection) {
                    TreeSelection treeSelection = (TreeSelection) selection;
                    Object node = treeSelection.getFirstElement();
                    if (node instanceof WGSchemaDocumentDefinition) {
                        WGSchemaDocumentDefinition def = (WGSchemaDocumentDefinition)node;
                        String typeName = "Document Definition";
                        if (def instanceof WGContentTypeDefinition) {
                            typeName = "Content Type Definition";
View Full Code Here


    }
   
    protected void handleAddItemDefinition() {
        ISelection selection = _treeViewer.getSelection();
        if (selection != null && selection instanceof TreeSelection) {
            TreeSelection structuredSelection = (TreeSelection) selection;
            Object node = structuredSelection.getFirstElement();
            WGContentTypeDefinition cTypeDefinition = retrieveCurrentContentTypeDefinition();
            if (cTypeDefinition != null) {
                WGContentItemDefinition itemDef = new WGContentItemDefinition();
                itemDef.setName("<name>");
                itemDef.setType(WGContentItemDefinition.Type.TEXT);
View Full Code Here

        }
    }

    protected WGContentTypeDefinition retrieveCurrentContentTypeDefinition() {
        if (_treeViewer != null) {
            TreeSelection treeSelection = (TreeSelection) _treeViewer.getSelection();
            if (!treeSelection.isEmpty()) {
                Object element = treeSelection.getFirstElement();
                if (element instanceof WGContentTypeDefinition) {
                    return (WGContentTypeDefinition) element;
                } else if (element instanceof WGMetaFieldDefinition) {
                    return _model.findContentTypeDefinition((WGMetaFieldDefinition)element);
                } else if (element instanceof WGContentItemDefinition) {
View Full Code Here

    }

    public void selectionChanged(SelectionChangedEvent e) {
        ISelection selection = e.getSelection();
        if (selection != null && selection instanceof TreeSelection) {
            TreeSelection structuredSelection = (TreeSelection) selection;
            Object node = structuredSelection.getFirstElement();
            if (node instanceof WGContentTypeDefinition) {
                _detailSection.setText("Content Type Definition");
                switchToSubform(SUBFORM_CONTENT_TYPE_DEFINITION, node);
            } else if (node instanceof WGAreaDefinition) {
                _detailSection.setText("Area Definition");
View Full Code Here

    private void refreshSelectedPath() {
        if (selectedPath != null) {
            TreePath treePath = contentProvider.findPath(selectedPath);
            if (treePath != null) {
                viewer.setSelection(new TreeSelection(treePath), true);
            }
            else {
                viewer.setSelection(TreeSelection.EMPTY);
            }
        }
View Full Code Here

        String[] result;
        if (viewer.getSelection().isEmpty()) {
            result = null;
        }
        else {
            TreeSelection selection = (TreeSelection) viewer.getSelection();
            TreePath treePath = selection.getPaths()[0];
            result = new String[treePath.getSegmentCount()];
            for (int i = 0; i < result.length; i++) {
                result[i] = treePath.getSegment(i).toString();
            }
        }
View Full Code Here

    private void refreshSelectedPath() {
        if (selectedPath != null) {
            TreePath treePath = contentProvider.findPath(selectedPath);
            if (treePath != null)
                viewer.setSelection(new TreeSelection(treePath), true);
            else
                viewer.setSelection(TreeSelection.EMPTY);
        }
    }
View Full Code Here

    String[] getSelectedPath() {
        String[] result;
        if (viewer.getSelection().isEmpty())
            result = null;
        else {
            TreeSelection selection = (TreeSelection) viewer.getSelection();
            TreePath treePath = selection.getPaths()[0];
            result = new String[treePath.getSegmentCount()];
            for (int i = 0; i < result.length; i++)
                result[i] = treePath.getSegment(i).toString();
        }
        return result;
View Full Code Here

            public void selectionChanged(final SelectionChangedEvent event) {
                final ISelection sel = event.getSelection();
                if (sel == null || sel.isEmpty()) {
                    return;
                }
                final TreeSelection tsel = (TreeSelection) sel;
                final AbstractResultTreeObject selection = (AbstractResultTreeObject) tsel
                        .getFirstElement();
                copyGeneralisedToClipboard.setText(selection.getSuggestedCode());

                if (selection instanceof DuplicatedCodeInstanceElement) {
                    final DuplicatedCodeInstanceElement dcie = (DuplicatedCodeInstanceElement) selection;
View Full Code Here

            return null;
        }
        final IDebugTarget target = (IDebugTarget) process.getAdapter(IDebugTarget.class);
        ISelection selection = null;
        if (target == null) {
            selection = new TreeSelection(new TreePath(new Object[] {
                    DebugPlugin.getDefault().getLaunchManager(), process.getLaunch(),
                    process }));
        } else {
            selection = new TreeSelection(new TreePath(new Object[] {
                    DebugPlugin.getDefault().getLaunchManager(), target.getLaunch(),
                    target }));
        }
        return new ShowInContext(null, selection);
    }
View Full Code Here

TOP

Related Classes of org.eclipse.jface.viewers.TreeSelection$InitializeData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.