Package org.drools.eclipse.util

Examples of org.drools.eclipse.util.DroolsRuntime


    }

    class DroolsRuntimesLabelProvider extends LabelProvider implements ITableLabelProvider {
        public String getColumnText(Object element, int columnIndex) {
            if (element instanceof DroolsRuntime) {
                DroolsRuntime runtime = (DroolsRuntime) element;
                switch(columnIndex) {
                    case 0:
                        return runtime.getName();
                    case 1:
                        return runtime.getPath();
                }
            }
            return element.toString();
        }
View Full Code Here


            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

    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

            String type = serverDefinition.getType();
            if (serverDefinition.isEnabled() && !droolsExists(serverDefinition)) {
                if (DROOLS.equals(type)) {
                    File droolsRoot = serverDefinition.getLocation();
                    if (droolsRoot.isDirectory()) {
                        DroolsRuntime runtime = new DroolsRuntime();
                        boolean startsWithDrools = serverDefinition.getName().startsWith(DROOLS_PREFIX);
                        String newName =   startsWithDrools ?  serverDefinition.getName() :
                          DROOLS_PREFIX + serverDefinition.getName();
                        runtime.setName(newName);

                        runtime.setPath(droolsRoot.getAbsolutePath());
                        DroolsRuntimeManager.recognizeJars(runtime);
                        runtime.setDefault(true);
                        droolsRuntimes.add(runtime);
                    }
                }
            }
            initializeInternal(serverDefinition.getIncludedRuntimeDefinitions(),
View Full Code Here

        if (files != null && files.length > 0) {
            String version = getImplementationVersion(root, files[0]);
            if (version != null) {
                version = version.substring(0, 3);
                String name = getDroolsRuntimeName(DROOLS_PREFIX + version);
                DroolsRuntime found = getRuntimeForLocation(root.getAbsolutePath());
                if( found != null) {
                  name = found.getName();
                }
                return new RuntimeDefinition(name, version, DROOLS,
                        root.getAbsoluteFile());
            }
        }
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

        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

    }

    class DroolsRuntimesLabelProvider extends LabelProvider implements ITableLabelProvider {
        public String getColumnText(Object element, int columnIndex) {
            if (element instanceof DroolsRuntime) {
                DroolsRuntime runtime = (DroolsRuntime) element;
                switch(columnIndex) {
                    case 0:
                        return runtime.getName();
                    case 1:
                        return runtime.getPath();
                }
            }
            return element.toString();
        }
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.