Search in sources :

Example 1 with Properties

use of org.netbeans.api.debugger.Properties in project enclojure by EricThorsen.

the class PersistenceManager method initBreakpoints.

public Breakpoint[] initBreakpoints() {
    try {
        Properties p = Properties.getDefault().getProperties("debugger").getProperties(DebuggerManager.PROP_BREAKPOINTS);
        Breakpoint[] breakpoints = (Breakpoint[]) p.getArray(CLOJURE_PROPERTY, new Breakpoint[0]);
        for (int i = 0; i < breakpoints.length; i++) {
            breakpoints[i].addPropertyChangeListener(this);
        }
        return breakpoints;
    } catch (Exception exc) {
        LOG.log(Level.SEVERE, exc.getMessage());
        exc.printStackTrace();
    }
    return new Breakpoint[] {};
}
Also used : Breakpoint(org.netbeans.api.debugger.Breakpoint) Properties(org.netbeans.api.debugger.Properties) Breakpoint(org.netbeans.api.debugger.Breakpoint)

Example 2 with Properties

use of org.netbeans.api.debugger.Properties in project enclojure by EricThorsen.

the class PersistenceManager method breakpointRemoved.

public void breakpointRemoved(Breakpoint breakpoint) {
    if (breakpoint instanceof ClojureLineBreakpoint) {
        Properties p = Properties.getDefault().getProperties("debugger").getProperties(DebuggerManager.PROP_BREAKPOINTS);
        p.setArray(CLOJURE_PROPERTY, getBreakpoints());
        breakpoint.removePropertyChangeListener(this);
    }
}
Also used : Properties(org.netbeans.api.debugger.Properties)

Example 3 with Properties

use of org.netbeans.api.debugger.Properties in project enclojure by EricThorsen.

the class CljSourcePath method initSourcePaths.

private void initSourcePaths() {
    Properties properties = Properties.getDefault().getProperties("debugger").getProperties("sources");
    Set originalSourceRoots = new HashSet(Arrays.asList(sourcePathProvider.getOriginalSourceRoots()));
    Set sourceRoots = new HashSet(Arrays.asList(sourcePathProvider.getSourceRoots()));
    Iterator enabledSourceRoots = properties.getProperties("source_roots").getCollection("enabled", Collections.EMPTY_SET).iterator();
    while (enabledSourceRoots.hasNext()) {
        String root = (String) enabledSourceRoots.next();
        if (originalSourceRoots.contains(root)) {
            sourceRoots.add(root);
        }
    }
    Iterator disabledSourceRoots = properties.getProperties("source_roots").getCollection("disabled", Collections.EMPTY_SET).iterator();
    while (disabledSourceRoots.hasNext()) {
        String root = (String) disabledSourceRoots.next();
        sourceRoots.remove(root);
    }
    String[] ss = new String[sourceRoots.size()];
    sourcePathProvider.setSourceRoots((String[]) sourceRoots.toArray(ss));
}
Also used : Set(java.util.Set) HashSet(java.util.HashSet) Iterator(java.util.Iterator) Properties(org.netbeans.api.debugger.Properties) HashSet(java.util.HashSet)

Example 4 with Properties

use of org.netbeans.api.debugger.Properties in project enclojure by EricThorsen.

the class PersistenceManager method breakpointAdded.

public void breakpointAdded(Breakpoint breakpoint) {
    if (breakpoint instanceof ClojureLineBreakpoint) {
        Properties p = Properties.getDefault().getProperties("debugger").getProperties(DebuggerManager.PROP_BREAKPOINTS);
        p.setArray(CLOJURE_PROPERTY, getBreakpoints());
        breakpoint.addPropertyChangeListener(this);
    }
}
Also used : Properties(org.netbeans.api.debugger.Properties)

Aggregations

Properties (org.netbeans.api.debugger.Properties)4 HashSet (java.util.HashSet)1 Iterator (java.util.Iterator)1 Set (java.util.Set)1 Breakpoint (org.netbeans.api.debugger.Breakpoint)1