org.eclipse.ui.model.WorkbenchViewerComparator Java Examples

The following examples show how to use org.eclipse.ui.model.WorkbenchViewerComparator. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ImportTraceWizardPage.java    From tracecompass with Eclipse Public License 2.0 6 votes vote down vote up
/**
 * Create the import source selection widget. (Copied from
 * WizardResourceImportPage but instead always uses the internal
 * ResourceTreeAndListGroup to keep compatibility with Kepler)
 */
@Override
protected void createFileSelectionGroup(Composite parent) {

    // Just create with a dummy root.
    fSelectionGroup = new ResourceTreeAndListGroup(parent,
            new FileSystemElement("Dummy", null, true), //$NON-NLS-1$
            getFolderProvider(), new WorkbenchLabelProvider(),
            getFileProvider(), new WorkbenchLabelProvider(), SWT.NONE,
            DialogUtil.inRegularFontMode(parent));

    ICheckStateListener listener = event -> updateWidgetEnablements();

    WorkbenchViewerComparator comparator = new WorkbenchViewerComparator();
    fSelectionGroup.setTreeComparator(comparator);
    fSelectionGroup.setListComparator(comparator);
    fSelectionGroup.addCheckStateListener(listener);

}
 
Example #2
Source File: CleanupPreferencePage.java    From eclipse-extras with Eclipse Public License 1.0 6 votes vote down vote up
private void createPageControls( Composite parent ) {
  cleanupButton = new Button( parent, SWT.CHECK );
  cleanupButton.setText( "Remove on-the-fly generated launch configurations when no longer needed" );
  cleanupButton.addListener( SWT.Selection, this::cleanupButtonSelected );
  cleanupTypesLabel = new Label( parent, SWT.NONE );
  cleanupTypesLabel.setText( "Select the launch configuration types to clean up" );
  cleanupTypesViewer = CheckboxTableViewer.newCheckList( parent, SWT.BORDER );
  cleanupTypesViewer.setLabelProvider( DebugUITools.newDebugModelPresentation() );
  cleanupTypesViewer.setContentProvider( ArrayContentProvider.getInstance() );
  cleanupTypesViewer.setComparator( new WorkbenchViewerComparator() );
  cleanupTypesViewer.addFilter( new LaunchConfigTypeFilter() );
  cleanupTypesViewer.setInput( launchManager.getLaunchConfigurationTypes() );
  selectAllButton = new Button( parent, SWT.PUSH );
  selectAllButton.addListener( SWT.Selection, event -> cleanupTypesViewer.setAllChecked( true ) );
  selectAllButton.setText( "&Select All" );
  deselectAllButton = new Button( parent, SWT.PUSH );
  deselectAllButton.setText( "&Deselect All" );
  deselectAllButton.addListener( SWT.Selection, event -> cleanupTypesViewer.setAllChecked( false ) );
  notelabel = new Label( parent, SWT.WRAP );
  String text
    = "Note: Launch configurations are considered as on-the-fly generated if "
    + "they were created outside the Run Configurations dialog without further "
    + "manual changes. For example with Run As > JUnit Test";
  notelabel.setText( text );
}