當前位置: 首頁>>代碼示例>>Java>>正文


Java IStructuredContentProvider類代碼示例

本文整理匯總了Java中org.eclipse.jface.viewers.IStructuredContentProvider的典型用法代碼示例。如果您正苦於以下問題:Java IStructuredContentProvider類的具體用法?Java IStructuredContentProvider怎麽用?Java IStructuredContentProvider使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


IStructuredContentProvider類屬於org.eclipse.jface.viewers包,在下文中一共展示了IStructuredContentProvider類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setColumnsViewerContent

import org.eclipse.jface.viewers.IStructuredContentProvider; //導入依賴的package包/類
/**
 * Set the content of the ColumnsViewer
 * 
 */
private void setColumnsViewerContent( )
{
    selectedColumnsViewer.setContentProvider( new IStructuredContentProvider( ) {

        public Object[] getElements( Object inputElement )
        {
            if ( inputElement instanceof java.util.List )
            {
                return ( (java.util.List<?>) inputElement ).toArray( );
            }

            return new Object[0];
        }

        public void dispose( )
        {
        }

        public void inputChanged( Viewer viewer, Object oldInput,
                Object newInput )
        {
        }
    } );
}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:29,代碼來源:ExcelFileSelectionWizardPage.java

示例2: getContentProvider

import org.eclipse.jface.viewers.IStructuredContentProvider; //導入依賴的package包/類
/**
 * Returns a content provider for the list dialog. It will return all projects in the workspace except the given
 * project, plus any projects referenced by the given project which do no exist in the workspace.
 *
 * @return the content provider that shows the project content
 */
private IStructuredContentProvider getContentProvider() {
    return new WorkbenchContentProvider() {
        @Override
        public Object[] getChildren(Object o) {
            if (!(o instanceof IWorkspace)) {
                return new Object[0];
            }

            // Collect all the projects in the workspace except the given project
            IProject[] projects = ((IWorkspace) o).getRoot().getProjects();
            List<IProject> applicableProjects = Lists.newArrayList();
            Optional<? extends IN4JSEclipseProject> projectOpt = null;
            for (IProject candidate : projects) {
                projectOpt = n4jsCore.create(candidate);
                if (projectOpt.isPresent() && projectOpt.get().exists()) {
                    applicableProjects.add(candidate);
                }
            }
            return applicableProjects.toArray(new IProject[applicableProjects.size()]);
        }
    };
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:29,代碼來源:AbstractExportToSingleFileWizardPage.java

示例3: getContentProvider

import org.eclipse.jface.viewers.IStructuredContentProvider; //導入依賴的package包/類
@Override
protected IStructuredContentProvider getContentProvider() {
    return new IStructuredContentProvider() {
        public Object[] getElements(Object inputElement) {
            String[] ret = new String[folders.size()];
            folders.toArray(ret);
            return ret;
        }

        public void dispose() {
        }

        public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {

        }
    };

}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:19,代碼來源:StringCustomListModel.java

示例4: setTableViewer

import org.eclipse.jface.viewers.IStructuredContentProvider; //導入依賴的package包/類
public TableViewer setTableViewer(TableViewer tableViewer, Composite composite, String[] prop,
        IStructuredContentProvider iStructuredContentProvider, ITableLabelProvider iTableLabelProvider) {

    tableViewer.setContentProvider(iStructuredContentProvider);

    tableViewer.setColumnProperties(prop);

    tableViewerTable = tableViewer.getTable();

    tableViewerTable.setVisible(true);
    tableViewerTable.setLinesVisible(true);
    tableViewerTable.setHeaderVisible(true);
    createTableColumns(tableViewerTable, prop);
    editors = createCellEditorList(tableViewerTable, prop.length);
    tableViewer.setCellEditors(editors);

    TableViewerEditor.create(tableViewer, new ColumnViewerEditorActivationStrategy(tableViewer),
            ColumnViewerEditor.KEYBOARD_ACTIVATION | ColumnViewerEditor.TABBING_HORIZONTAL
                    | ColumnViewerEditor.TABBING_MOVE_TO_ROW_NEIGHBOR | ColumnViewerEditor.TABBING_VERTICAL);

    return tableViewer;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:23,代碼來源:ELTOperationClassDialog.java

示例5: createSourceTable

import org.eclipse.jface.viewers.IStructuredContentProvider; //導入依賴的package包/類
private void createSourceTable(SashForm sashForm) {
    avaliableFieldTableViewer = new TableViewer(sashForm, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
    table_1 = avaliableFieldTableViewer.getTable();
    table_1.setLinesVisible(true);
    table_1.setHeaderVisible(true);
    avaliableFieldTableViewer.setContentProvider(new IStructuredContentProvider() {

        @Override
        public Object[] getElements(Object inputElement) {
            return ((List) inputElement).toArray();
        }
    });
    avaliableFieldTableViewer.setInput(schemaFields);

    TableViewerColumn tableViewerColumn_2 = new TableViewerColumn(avaliableFieldTableViewer, SWT.NONE);
    TableColumn tblclmnNewColumn_2 = tableViewerColumn_2.getColumn();
    tblclmnNewColumn_2.setWidth(196);
    tblclmnNewColumn_2.setText(Messages.AVAILABLE_FIELDS_HEADER);
    tableViewerColumn_2.setLabelProvider(new ColumnLabelProvider());

    attachDragListener();
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:23,代碼來源:ExcelFormattingDialog.java

示例6: setTableViewer

import org.eclipse.jface.viewers.IStructuredContentProvider; //導入依賴的package包/類
public TableViewer setTableViewer(TableViewer tableViewer, Composite composite, String[] prop,
        IStructuredContentProvider iStructuredContentProvider) {

    tableViewer.setContentProvider(iStructuredContentProvider);

    tableViewer.setColumnProperties(prop);

    tableViewerTable = tableViewer.getTable();

    tableViewerTable.setVisible(true);
    tableViewerTable.setLinesVisible(true);
    tableViewerTable.setHeaderVisible(true);
    createTableColumns(tableViewerTable, prop);
    editors = createCellEditorList(tableViewerTable, prop.length);
    tableViewer.setCellEditors(editors);

    TableViewerEditor.create(tableViewer, new ColumnViewerEditorActivationStrategy(tableViewer),
            ColumnViewerEditor.KEYBOARD_ACTIVATION | ColumnViewerEditor.TABBING_HORIZONTAL
                    | ColumnViewerEditor.TABBING_MOVE_TO_ROW_NEIGHBOR | ColumnViewerEditor.TABBING_VERTICAL);

    return tableViewer;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:23,代碼來源:TransformDialog.java

示例7: createFileListViewer

import org.eclipse.jface.viewers.IStructuredContentProvider; //導入依賴的package包/類
/**
 * Creates a ListViewer whose input is an array of IFiles.
 * 
 * @param parent  the parent of the viewer
 * @param title  the text for the title label
 * @param heightHint  the nominal height of the list
 * @return the created list viewer
 */
public ListViewer createFileListViewer(Composite parent, String title, int heightHint) {
    createLabel(parent, title);
    ListViewer listViewer = new ListViewer(parent, SWT.READ_ONLY | SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER);
    listViewer.setContentProvider(new IStructuredContentProvider() {
        public Object[] getElements(Object inputElement) {
            return (Object[]) inputElement;
        }
        public void dispose() {
        }
        public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
        }
    });
    listViewer.setLabelProvider(new LabelProvider() {
        public String getText(Object element) {
            return ((IFile) element).getFullPath().toString();
        }
    });
    listViewer.setSorter(new WorkbenchViewerSorter());

    GridData data = new GridData(GridData.FILL_BOTH);
    data.heightHint = heightHint;
    listViewer.getList().setLayoutData(data);
    return listViewer;
}
 
開發者ID:subclipse,項目名稱:subclipse,代碼行數:33,代碼來源:SVNWizardPage.java

示例8: getLabel

import org.eclipse.jface.viewers.IStructuredContentProvider; //導入依賴的package包/類
public String getLabel() {
    String label= super.getLabel();
    StructuredViewer viewer= getViewer();
    if (viewer instanceof TableViewer) {
        TableViewer tv= (TableViewer) viewer;

        AbstractTextSearchResult result= getInput();
        if (result != null) {
            int itemCount= ((IStructuredContentProvider) tv.getContentProvider()).getElements(getInput()).length;
            if (showLineMatches()) {
                int matchCount= getInput().getMatchCount();
                if (itemCount < matchCount) {
                    return Messages.format(SearchMessages.FileSearchPage_limited_format_matches, new Object[]{label, new Integer(itemCount), new Integer(matchCount)});
                }
            } else {
                int fileCount= getInput().getElements().length;
                if (itemCount < fileCount) {
                    return Messages.format(SearchMessages.FileSearchPage_limited_format_files, new Object[]{label, new Integer(itemCount), new Integer(fileCount)});
                }
            }
        }
    }
    return label;
}
 
開發者ID:angelozerr,項目名稱:typescript.java,代碼行數:25,代碼來源:TypeScriptSearchResultPage.java

示例9: createBooleanComboBox

import org.eclipse.jface.viewers.IStructuredContentProvider; //導入依賴的package包/類
/**
 * createBooleanComboBox
 *   void
 */
private void createBooleanComboBox() {
    cellEditor = new ComboBoxViewerCellEditor(tableViewer.getTable(), SWT.READ_ONLY);
    ((ComboBoxViewerCellEditor) cellEditor).setContenProvider(new IStructuredContentProvider() {
        /**
         * @see org.eclipse.jface.viewers.IContentProvider#dispose()
         */
        public void dispose() {
        }

        /**
         * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
         */
        public Object[] getElements(Object inputElement) {
            return (Object[]) inputElement;
        }

        /**
         * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer,
         *      java.lang.Object, java.lang.Object)
         */
        public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
        }
    });
    ((ComboBoxViewerCellEditor) cellEditor).setInput(UICoreConstant.UMLSECTION_CONSTANTS__DEFAULT_VALUES_BOOLEAN);
}
 
開發者ID:SK-HOLDINGS-CC,項目名稱:NEXCORE-UML-Modeler,代碼行數:30,代碼來源:AttributeSection.java

示例10: getContentProvider

import org.eclipse.jface.viewers.IStructuredContentProvider; //導入依賴的package包/類
/**
 * getContentProvider
 *  
 * @return IStructuredContentProvider
 */
private IStructuredContentProvider getContentProvider() {
    return new IStructuredContentProvider() {
        /**
         * @see org.eclipse.jface.viewers.IContentProvider#dispose()
         */
        public void dispose() {
        }

        /**
         * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
         */
        public Object[] getElements(Object inputElement) {
            return (Object[]) inputElement;
        }

        /**
         * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer,
         *      java.lang.Object, java.lang.Object)
         */
        public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
        }
    };
}
 
開發者ID:SK-HOLDINGS-CC,項目名稱:NEXCORE-UML-Modeler,代碼行數:29,代碼來源:ParameterSection.java

示例11: XtextEObjectSearchDialog

import org.eclipse.jface.viewers.IStructuredContentProvider; //導入依賴的package包/類
public XtextEObjectSearchDialog(Shell parent, IXtextEObjectSearch searchEngine, ILabelProvider labelProvider) {
    super(parent);
    this.searchEngine = searchEngine;
    this.labelProvider = labelProvider;
    setTitle(Messages.XtextEObjectSearchDialog_TableLabelDialogTitle);
    setMessage(Messages.XtextEObjectSearchDialog_TableLabelSearchControlLabel);
    setAddCancelButton(true);
    // super class needs an IStructuredContentProvider so we register this dummy and 
    // register the lazy one later
    setContentProvider(new IStructuredContentProvider() {
        public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
        }

        public void dispose() {
        }

        public Object[] getElements(Object inputElement) {
            return null;
        }
    });
    setLabelProvider(labelProvider);
}
 
開發者ID:cplutte,項目名稱:bts,代碼行數:23,代碼來源:XtextEObjectSearchDialog.java

示例12: ProjectSelectionDialog

import org.eclipse.jface.viewers.IStructuredContentProvider; //導入依賴的package包/類
public ProjectSelectionDialog(Shell parentShell, Object input,
        IStructuredContentProvider contentProvider,
        ILabelProvider labelProvider, String message, String unifiedDiff) {
    super(parentShell);
    this.unifiedDiff = unifiedDiff;
    featureController.getFeatures(VariantSyncPlugin.getDefault()
            .getSupportProjectList());
    setTitle(WorkbenchMessages.ListSelection_title);
    inputElement = input;
    projectSelectionDiaglog = this;
    this.projectContentProvider = contentProvider;
    this.featureContentProvider = new FeatureListViewerContentProvider();
    this.projectLabelProvider = labelProvider;
    this.featureLabelProvider = new LabelProvider();
    if (message != null) {
        setMessage(message);
    } else {
        setMessage(WorkbenchMessages.ListSelection_message);
    }
}
 
開發者ID:1Tristan,項目名稱:VariantSync,代碼行數:21,代碼來源:ProjectSelectionDialog.java

示例13: getContentProvider

import org.eclipse.jface.viewers.IStructuredContentProvider; //導入依賴的package包/類
/**
 * getContentProvider
 * 
 * @return
 */
private IStructuredContentProvider getContentProvider()
{
    return new BaseWorkbenchContentProvider()
    {
        /*
         * (non-Javadoc)
         * @see org.eclipse.ui.model.BaseWorkbenchContentProvider#getChildren(java.lang.Object)
         */
        @Override
        public Object[] getChildren(Object element)
        {
            if (element instanceof Set<?>)
            {
                return ((Set<?>) element).toArray();
            }
            return super.getChildren(element);
        }
    };
}
 
開發者ID:apicloudcom,項目名稱:APICloud-Studio,代碼行數:25,代碼來源:ProjectBuildPathPropertyPage.java

示例14: createControl

import org.eclipse.jface.viewers.IStructuredContentProvider; //導入依賴的package包/類
@Override
public void createControl(Composite parent) {
    Composite composite = new EnsembleComposite(parent, SWT.NONE);
    control = composite;
    IStructuredContentProvider contentProvider = new IStructuredContentProvider() {
        @Override
        public Object[] getElements(Object inputElement) {
            EPlan plan = (EPlan) inputElement;
            ResourceConditionsMember member = plan.getMember(ResourceConditionsMember.class);
            return member.getConditions().toArray();
        }

        @Override
        public void dispose() { /* empty */
        }

        @Override
        public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { /* empty */
        }
    };
    inconsViewer = InconsTableUtils.getTableViewer(composite, contentProvider);
    inconsViewer.setInput(plan);
    setup();
}
 
開發者ID:nasa,項目名稱:OpenSPIFe,代碼行數:25,代碼來源:InconsPage.java

示例15: CheckboxTreeAndListGroup

import org.eclipse.jface.viewers.IStructuredContentProvider; //導入依賴的package包/類
/**
 *	Creates an instance of this class.  Use this constructor if you wish to specify
 *	the width and/or height of the combined widget (to only hardcode one of the
 *	sizing dimensions, specify the other dimension's value as -1)
 * @param parent parent composite
 * @param rootObject
 * @param treeContentProvider
 * @param treeLabelProvider
 * @param listContentProvider
 * @param listLabelProvider
 * @param style
 * @param width the width
 * @param height the height
 */
public CheckboxTreeAndListGroup(
        Composite parent,
        Object rootObject,
        ITreeContentProvider treeContentProvider,
        ILabelProvider treeLabelProvider,
        IStructuredContentProvider listContentProvider,
        ILabelProvider listLabelProvider,
        int style,
        int width,
        int height) {
    fRoot= rootObject;
    fTreeContentProvider= treeContentProvider;
    fListContentProvider= listContentProvider;
    fTreeLabelProvider= treeLabelProvider;
    fListLabelProvider= listLabelProvider;
    createContents(parent, width, height, style);
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:32,代碼來源:CheckboxTreeAndListGroup.java


注:本文中的org.eclipse.jface.viewers.IStructuredContentProvider類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。