/**
   * Creates the checkbox tree and list for selecting resources.
   *
   * @param parent the parent control
   */
  protected final void createResourcesGroup(final Composite parent) {
    final Table table = new Table(parent, SWT.BORDER | SWT.CHECK);
    final CheckboxTableViewer viewer = new CheckboxTableViewer(table);
    viewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    viewer.setContentProvider(new ArrayContentProvider());
    viewer.setLabelProvider(new WorkbenchLabelProvider());
    viewer.setComparator(new ViewerComparator());

    viewer.setInput(m_data.getWspmProjects());

    final IViewerObservableSet target =
        ViewersObservables.observeCheckedElements(viewer, IProject.class);
    final WritableSet model = m_data.getSelectedProjectList();
    final DataSetBinder binder = new DataSetBinder(target, model);
    m_binding.bindValue(binder);
  }
  /* (non-Javadoc)
   * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
   */
  @Override
  public void createControl(Composite parent) {
    context = new EMFDataBindingContext();

    final Composite mainComposite = new Composite(parent, SWT.NONE);
    mainComposite.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());
    mainComposite.setLayout(
        GridLayoutFactory.fillDefaults().numColumns(1).margins(15, 15).create());

    final Text searchText =
        new Text(mainComposite, SWT.SEARCH | SWT.ICON_SEARCH | SWT.BORDER | SWT.CANCEL);
    searchText.setMessage(Messages.search);
    searchText.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());

    final CheckboxTableViewer languageViewer =
        CheckboxTableViewer.newCheckList(
            mainComposite, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI | SWT.V_SCROLL);
    languageViewer
        .getTable()
        .setLayoutData(
            GridDataFactory.fillDefaults().grab(true, true).hint(SWT.DEFAULT, 190).create());
    languageViewer.getTable().setLinesVisible(true);
    languageViewer.getTable().setHeaderVisible(true);
    final TableLayout layout = new TableLayout();
    layout.addColumnData(new ColumnWeightData(65));
    layout.addColumnData(new ColumnWeightData(35));
    languageViewer.getTable().setLayout(layout);
    languageViewer.setContentProvider(new ArrayContentProvider());
    languageViewer.setLabelProvider(new LocaleLabelProvider());

    searchFilter =
        new ViewerFilter() {

          @Override
          public boolean select(Viewer arg0, Object arg1, Object element) {
            if (!searchText.getText().isEmpty()) {
              String searchQuery = searchText.getText().toLowerCase();
              Locale locale = (Locale) element;
              return locale.toString().toLowerCase().contains(searchQuery)
                  || locale.getDisplayName().toLowerCase().contains(searchQuery);
            }
            return true;
          }
        };
    languageViewer.addFilter(searchFilter);
    languageViewer.setInput(Locale.getAvailableLocales());
    languageViewer.getTable().setFocus();

    TableViewerColumn countryNameColumn = new TableViewerColumn(languageViewer, SWT.FILL);
    countryNameColumn.setLabelProvider(new LocaleLabelProvider());
    countryNameColumn.getColumn().setText(Messages.countryName);

    TableViewerColumn localeCodeNameColumn = new TableViewerColumn(languageViewer, SWT.FILL);
    localeCodeNameColumn.setLabelProvider(
        new ColumnLabelProvider() {
          @Override
          public String getText(Object element) {
            return ((Locale) element).toString();
          }
        });

    localeCodeNameColumn.getColumn().setText(Messages.locale);

    new TableColumnSorter(languageViewer).setColumn(countryNameColumn.getColumn());

    context.bindSet(
        ViewersObservables.observeCheckedElements(languageViewer, Locale.class),
        PojoObservables.observeSet(this, "selectedLocales"));

    searchText.addModifyListener(
        new ModifyListener() {

          @Override
          public void modifyText(ModifyEvent e) {
            languageViewer.refresh();
          }
        });

    pageSupport = WizardPageSupport.create(this, context);
    setControl(mainComposite);
  }