Package org.drools.eclipse.util

Examples of org.drools.eclipse.util.DroolsRuntime


            monitor.done();
        }
    }
   
    private void createDroolsRuntime(IJavaProject project, IProgressMonitor monitor) throws CoreException {
        DroolsRuntime runtime = runtimePage.getDroolsRuntime();
        if (runtime != null) {
            IFile file = project.getProject().getFile(".settings/.drools.runtime");
            String runtimeString = "<runtime>" + runtime.getName() + "</runtime>";
            if (!file.exists()) {
                IFolder folder = project.getProject().getFolder(".settings");
                if (!folder.exists()) {
                    folder.create(true, true, null);
                }
View Full Code Here


        Composite composite = new Composite(parent, SWT.NONE);
        GridLayout gridLayout = new GridLayout();
        gridLayout.numColumns = 2;
        composite.setLayout(gridLayout);
       
        DroolsRuntime defaultRuntime = DroolsRuntimeManager.getDefaultDroolsRuntime();
        projectSpecificRuntime = createCheckBox(composite,
            "Use default Drools Runtime (currently "
                + (defaultRuntime == null ? "undefined)" : defaultRuntime.getName() + ")"));
        projectSpecificRuntime.setSelection(true);
        projectSpecificRuntime.addSelectionListener(new SelectionListener() {
            public void widgetDefaultSelected(SelectionEvent e) {
                // do nothing
            }
View Full Code Here

                droolsRuntimeCombo.add(runtimes[i].getName());
            }
            droolsRuntimeCombo.select(0);
            selectedRuntime = droolsRuntimeCombo.getText();
        }
        DroolsRuntime defaultRuntime = DroolsRuntimeManager.getDefaultDroolsRuntime();
        projectSpecificRuntime.setText("Use default Drools Runtime (currently "
            + (defaultRuntime == null ? "undefined)" : defaultRuntime.getName() + ")"));
    }
View Full Code Here

        data.widthHint = 450;
        control.setLayoutData(data);

        droolsRuntimesBlock.addSelectionChangedListener(new ISelectionChangedListener() {
            public void selectionChanged(SelectionChangedEvent event) {
                DroolsRuntime runtime = droolsRuntimesBlock.getDefaultDroolsRuntime();
                if (runtime == null) {
                    setErrorMessage("Select a default Drools Runtime");
                } else {
                    setErrorMessage(null);
                }
View Full Code Here

    public DroolsRuntime getResult() {
        return runtime;
    }

    protected void okPressed() {
        runtime = new DroolsRuntime();
        runtime.setName(nameText.getText());
        runtime.setPath(pathText.getText());
        super.okPressed();
    }
View Full Code Here

        }
        droolsRuntimesList.refresh();
    }

    public DroolsRuntime[] getDroolsRuntimes() {
        DroolsRuntime selected = getDefaultDroolsRuntime();
        for (DroolsRuntime runtime: droolsRuntimes) {
            runtime.setDefault(runtime.equals(selected));
        }
        return droolsRuntimes.toArray(new DroolsRuntime[droolsRuntimes.size()]);
    }
View Full Code Here

    }

    private void addDroolsRuntime() {
        DroolsRuntimeDialog dialog = new DroolsRuntimeDialog(getShell(), droolsRuntimes);
        if (dialog.open() == Window.OK) {
            DroolsRuntime result = dialog.getResult();
            if (result != null) {
                DroolsRuntimeManager.recognizeJars(result);
                droolsRuntimes.add(result);
                droolsRuntimesList.refresh();
                droolsRuntimesList.setSelection(new StructuredSelection(result));
View Full Code Here

        }
    }

    private void editDroolsRuntime() {
        IStructuredSelection selection= (IStructuredSelection) droolsRuntimesList.getSelection();
        DroolsRuntime runtime = (DroolsRuntime) selection.getFirstElement();
        if (runtime == null) {
            return;
        }
        DroolsRuntimeDialog dialog = new DroolsRuntimeDialog(getShell(), droolsRuntimes);
        dialog.setDroolsRuntime(runtime);
        if (dialog.open() == Window.OK) {
            DroolsRuntime result = dialog.getResult();
            if (result != null) {
                DroolsRuntimeManager.recognizeJars(result);
                // replace with the edited VM
                int index = droolsRuntimes.indexOf(runtime);
                droolsRuntimes.remove(index);
View Full Code Here

        Composite composite = new Composite(parent, SWT.NONE);
        GridLayout gridLayout = new GridLayout();
        gridLayout.numColumns = 2;
        composite.setLayout(gridLayout);
       
        DroolsRuntime defaultRuntime = DroolsRuntimeManager.getDefaultDroolsRuntime();
        projectSpecificRuntime = createCheckBox(composite,
            "Use default Drools Runtime (currently "
                + (defaultRuntime == null ? "undefined)" : defaultRuntime.getName() + ")"));
        projectSpecificRuntime.setSelection(true);
        projectSpecificRuntime.addSelectionListener(new SelectionListener() {
            public void widgetDefaultSelected(SelectionEvent e) {
                // do nothing
            }
View Full Code Here

                droolsRuntimeCombo.add(runtimes[i].getName());
            }
            droolsRuntimeCombo.select(0);
            selectedRuntime = droolsRuntimeCombo.getText();
        }
        DroolsRuntime defaultRuntime = DroolsRuntimeManager.getDefaultDroolsRuntime();
        projectSpecificRuntime.setText("Use default Drools Runtime (currently "
            + (defaultRuntime == null ? "undefined)" : defaultRuntime.getName() + ")"));
    }
View Full Code Here

TOP

Related Classes of org.drools.eclipse.util.DroolsRuntime

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.