Search in sources :

Example 1 with JavaElementComparator

use of org.eclipse.jdt.ui.JavaElementComparator in project liferay-ide by liferay.

the class ProjectSelectionDialog method createDialogArea.

/**
 * (non-Javadoc) Method declared on Dialog.
 */
protected Control createDialogArea(Composite parent) {
    // page group
    Composite composite = (Composite) super.createDialogArea(parent);
    Font font = parent.getFont();
    composite.setFont(font);
    createMessageArea(composite);
    fTableViewer = CheckboxTableViewer.newCheckList(composite, SWT.BORDER);
    fTableViewer.addPostSelectionChangedListener(new ISelectionChangedListener() {

        @Override
        public void selectionChanged(SelectionChangedEvent event) {
            updateOKButtonState(event);
        }
    });
    addSelectionButtons(composite);
    GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
    data.heightHint = _sizingSelectionWidgetHeight;
    data.widthHint = _sizingSelectionWidgetWidth;
    fTableViewer.getTable().setLayoutData(data);
    fTableViewer.setLabelProvider(new JavaElementLabelProvider());
    fTableViewer.setContentProvider(getContentProvider());
    fTableViewer.setComparator(new JavaElementComparator());
    fTableViewer.getControl().setFont(font);
    updateFilter(true);
    IJavaModel input = JavaCore.create(ResourcesPlugin.getWorkspace().getRoot());
    fTableViewer.setInput(input);
    initialize();
    _selectionChanged(new Object[0]);
    Dialog.applyDialogFont(composite);
    return composite;
}
Also used : Composite(org.eclipse.swt.widgets.Composite) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) GridData(org.eclipse.swt.layout.GridData) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) JavaElementComparator(org.eclipse.jdt.ui.JavaElementComparator) Font(org.eclipse.swt.graphics.Font) JavaElementLabelProvider(org.eclipse.jdt.ui.JavaElementLabelProvider) IJavaModel(org.eclipse.jdt.core.IJavaModel)

Example 2 with JavaElementComparator

use of org.eclipse.jdt.ui.JavaElementComparator in project whole by wholeplatform.

the class WizardPojoModelImportPage1 method createSourceGroup.

@Override
protected void createSourceGroup(Composite parent) {
    resourceChooser = new TreeViewer(parent);
    GridLayout listAreaLayout = new GridLayout();
    listAreaLayout.marginWidth = 0;
    parent.setLayout(listAreaLayout);
    resourceChooser.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
    resourceChooser.setContentProvider(new StandardJavaElementContentProvider());
    resourceChooser.setLabelProvider(new JavaElementLabelProvider());
    resourceChooser.setComparator(new JavaElementComparator());
    resourceChooser.addFilter(new JavaClassFileFilter());
    resourceChooser.setInput(JavaCore.create(ResourcesPlugin.getWorkspace().getRoot()));
    resourceChooser.addSelectionChangedListener(new ISelectionChangedListener() {

        public void selectionChanged(SelectionChangedEvent event) {
            updatePageCompletion();
        }
    });
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) StandardJavaElementContentProvider(org.eclipse.jdt.ui.StandardJavaElementContentProvider) TreeViewer(org.eclipse.jface.viewers.TreeViewer) JavaClassFileFilter(org.whole.lang.ui.controls.JavaClassFileFilter) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) GridData(org.eclipse.swt.layout.GridData) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) JavaElementComparator(org.eclipse.jdt.ui.JavaElementComparator) JavaElementLabelProvider(org.eclipse.jdt.ui.JavaElementLabelProvider)

Example 3 with JavaElementComparator

use of org.eclipse.jdt.ui.JavaElementComparator in project whole by wholeplatform.

the class WizardJavaModelImportPage1 method createSourceGroup.

@Override
protected void createSourceGroup(Composite parent) {
    resourceChooser = new TreeViewer(parent, SWT.SINGLE);
    GridLayout listAreaLayout = new GridLayout();
    listAreaLayout.marginWidth = 0;
    parent.setLayout(listAreaLayout);
    resourceChooser.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
    resourceChooser.setContentProvider(new StandardJavaElementContentProvider());
    resourceChooser.setLabelProvider(new JavaElementLabelProvider());
    resourceChooser.setComparator(new JavaElementComparator());
    resourceChooser.addFilter(new JavaClassFileFilter());
    resourceChooser.setInput(JavaCore.create(ResourcesPlugin.getWorkspace().getRoot()));
    resourceChooser.addSelectionChangedListener(new ISelectionChangedListener() {

        public void selectionChanged(SelectionChangedEvent event) {
            updatePageCompletion();
        }
    });
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) StandardJavaElementContentProvider(org.eclipse.jdt.ui.StandardJavaElementContentProvider) TreeViewer(org.eclipse.jface.viewers.TreeViewer) JavaClassFileFilter(org.whole.lang.ui.controls.JavaClassFileFilter) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) GridData(org.eclipse.swt.layout.GridData) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) JavaElementComparator(org.eclipse.jdt.ui.JavaElementComparator) JavaElementLabelProvider(org.eclipse.jdt.ui.JavaElementLabelProvider)

Example 4 with JavaElementComparator

use of org.eclipse.jdt.ui.JavaElementComparator in project whole by wholeplatform.

the class ClassBrowseChooser method createDialog.

protected Dialog createDialog() {
    StandardJavaElementContentProvider provider = new StandardJavaElementContentProvider();
    ILabelProvider labelProvider = new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_DEFAULT);
    ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(), labelProvider, provider);
    dialog.setTitle("Package selection");
    dialog.setMessage("Choose a package fragment");
    dialog.setComparator(new JavaElementComparator());
    dialog.addFilter(new JavaPackageFragmentFilter());
    dialog.setValidator(new JavaPackageFragmentValidator());
    dialog.setInput(JavaCore.create(ResourcesPlugin.getWorkspace().getRoot()));
    dialog.setHelpAvailable(false);
    return dialog;
}
Also used : ElementTreeSelectionDialog(org.eclipse.ui.dialogs.ElementTreeSelectionDialog) StandardJavaElementContentProvider(org.eclipse.jdt.ui.StandardJavaElementContentProvider) ILabelProvider(org.eclipse.jface.viewers.ILabelProvider) JavaElementComparator(org.eclipse.jdt.ui.JavaElementComparator) JavaElementLabelProvider(org.eclipse.jdt.ui.JavaElementLabelProvider)

Example 5 with JavaElementComparator

use of org.eclipse.jdt.ui.JavaElementComparator in project whole by wholeplatform.

the class PackageFragmentBrowseChooser method createDialog.

protected Dialog createDialog() {
    StandardJavaElementContentProvider provider = new StandardJavaElementContentProvider();
    ILabelProvider labelProvider = new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_DEFAULT);
    ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(), labelProvider, provider);
    dialog.setTitle("Packcage selection");
    dialog.setMessage("Choose a package fragment");
    dialog.setComparator(new JavaElementComparator());
    dialog.addFilter(new JavaPackageFragmentFilter());
    dialog.setValidator(new JavaPackageFragmentValidator());
    dialog.setInput(JavaCore.create(ResourcesPlugin.getWorkspace().getRoot()));
    dialog.setHelpAvailable(false);
    return dialog;
}
Also used : ElementTreeSelectionDialog(org.eclipse.ui.dialogs.ElementTreeSelectionDialog) StandardJavaElementContentProvider(org.eclipse.jdt.ui.StandardJavaElementContentProvider) ILabelProvider(org.eclipse.jface.viewers.ILabelProvider) JavaElementComparator(org.eclipse.jdt.ui.JavaElementComparator) JavaElementLabelProvider(org.eclipse.jdt.ui.JavaElementLabelProvider)

Aggregations

JavaElementComparator (org.eclipse.jdt.ui.JavaElementComparator)5 JavaElementLabelProvider (org.eclipse.jdt.ui.JavaElementLabelProvider)5 StandardJavaElementContentProvider (org.eclipse.jdt.ui.StandardJavaElementContentProvider)4 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)3 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)3 GridData (org.eclipse.swt.layout.GridData)3 ILabelProvider (org.eclipse.jface.viewers.ILabelProvider)2 TreeViewer (org.eclipse.jface.viewers.TreeViewer)2 GridLayout (org.eclipse.swt.layout.GridLayout)2 ElementTreeSelectionDialog (org.eclipse.ui.dialogs.ElementTreeSelectionDialog)2 JavaClassFileFilter (org.whole.lang.ui.controls.JavaClassFileFilter)2 IJavaModel (org.eclipse.jdt.core.IJavaModel)1 Font (org.eclipse.swt.graphics.Font)1 Composite (org.eclipse.swt.widgets.Composite)1