Search in sources :

Example 1 with ProjectLabelProvider

use of org.erlide.cover.ui.launch.helpers.ProjectLabelProvider in project erlide_eclipse by erlang.

the class CoverMainTab method createModuleGroup.

private void createModuleGroup(final Composite comp) {
    final ElementListSelectionDialog projectDialog = new ElementListSelectionDialog(getShell(), new ProjectLabelProvider());
    final Object[] elements = createProjectArray();
    projectDialog.setElements(elements);
    projectDialog.setTitle("Select project");
    projectDialog.setMessage("Select Erlang project: ");
    moduleDialog = new ElementListSelectionDialog(getShell(), new ProjectLabelProvider());
    moduleDialog.setElements(new Object[0]);
    moduleDialog.setTitle("Select module");
    moduleDialog.setMessage("Select Erlang module: ");
    projectMBr = browserWithLabel(comp, "Project:", projectDialog);
    projectMBr.addModifyListener(new ModifyListener() {

        @Override
        public void modifyText(final ModifyEvent e) {
            updateLaunchConfigurationDialog();
            final String projectName = projectMBr.getText();
            if (projectName != null && !projectName.isEmpty()) {
                final IErlProject p = ErlangEngine.getInstance().getModel().getErlangProject(ResourcesPlugin.getWorkspace().getRoot().getProject(projectName));
                if (p != null) {
                    moduleDialog.setElements(createModuleArray(p));
                }
            }
        }
    });
    moduleBr = browserWithLabel(comp, "Module:", moduleDialog);
    moduleBr.addModifyListener(basicModifyListener);
}
Also used : IErlProject(org.erlide.engine.model.root.IErlProject) ModifyEvent(org.eclipse.swt.events.ModifyEvent) ProjectLabelProvider(org.erlide.cover.ui.launch.helpers.ProjectLabelProvider) ModifyListener(org.eclipse.swt.events.ModifyListener) ElementListSelectionDialog(org.eclipse.ui.dialogs.ElementListSelectionDialog)

Example 2 with ProjectLabelProvider

use of org.erlide.cover.ui.launch.helpers.ProjectLabelProvider in project erlide_eclipse by erlang.

the class CoverMainTab method createAllTestsGroup.

private void createAllTestsGroup(final Composite comp) {
    final ElementListSelectionDialog projectDialog = new ElementListSelectionDialog(getShell(), new ProjectLabelProvider());
    final Object[] elements = createProjectArray();
    projectDialog.setElements(elements);
    projectDialog.setTitle("Select project");
    projectDialog.setMessage("Select Erlang project: ");
    fileBr = new ItemBrowser(comp, SWT.SINGLE | SWT.BORDER, projectDialog);
    fileBr.setFiledLength(600);
    fileBr.getTextGridData().horizontalSpan = 2;
    fileBr.addModifyListener(basicModifyListener);
}
Also used : ProjectLabelProvider(org.erlide.cover.ui.launch.helpers.ProjectLabelProvider) ElementListSelectionDialog(org.eclipse.ui.dialogs.ElementListSelectionDialog)

Aggregations

ElementListSelectionDialog (org.eclipse.ui.dialogs.ElementListSelectionDialog)2 ProjectLabelProvider (org.erlide.cover.ui.launch.helpers.ProjectLabelProvider)2 ModifyEvent (org.eclipse.swt.events.ModifyEvent)1 ModifyListener (org.eclipse.swt.events.ModifyListener)1 IErlProject (org.erlide.engine.model.root.IErlProject)1