Package org.enhydra.jawe

Examples of org.enhydra.jawe.XPDLListenerAndObservable


        if (xpdlId == null) {
            xpdlId = getMainPackageId();
        }
        Iterator it = xpdlListenerObservables.iterator();
        while (it.hasNext()) {
            XPDLListenerAndObservable xpdl = (XPDLListenerAndObservable) it.next();
            if (xpdl.getPackage() != null && xpdl.getPackage().getId().equals(xpdlId)) {
                return xpdl.isModified();
            }
        }
        return false;
    }
View Full Code Here


                            changed = adjustXPDL(p);
                        } catch (Exception e) {
                            // ignore
                        }

                        XPDLListenerAndObservable xpdl;
                        if (p == pkg) {
                            xpdl = createNewXPDLListenerObservable(pkg, true, false);
                            if (changed) {
                                mainChanged = true;
                            }
                        } else {
                            xpdl = createNewXPDLListenerObservable(p, false, false);
                            p.setReadOnly(true);
                        }
                        xpdl.setModified(changed);
                    }

                    List inserted = new ArrayList();
                    inserted.add(pkg);
View Full Code Here

                    it = pkgsToInsert.iterator();
                    while (it.hasNext()) {
                        Package p = (Package) it.next();
                        boolean changed = adjustXPDL(p);
                        XPDLListenerAndObservable xpdl;
                        xpdl = createNewXPDLListenerObservable(p, false, false);
                        p.setReadOnly(true);
                        xpdl.setModified(changed);
                    }

                    setChanged();
                    notifyObservers(createInfo(mainPkg,
                            new ArrayList(pkgsToInsert),
View Full Code Here

                    it = pkgsToInsert.iterator();
                    while (it.hasNext()) {
                        Package p = (Package) it.next();
                        boolean changed = adjustXPDL(p);
                        XPDLListenerAndObservable xpdl;
                        xpdl = createNewXPDLListenerObservable(p, false, false);
                        p.setReadOnly(true);
                        xpdl.setModified(changed);
                    }

                    setChanged();
                    notifyObservers(createInfo(mainPkg,
                            new ArrayList(pkgsToInsert),
View Full Code Here

            }
            if (pkgsToRemove.size() > 0) {
                it = pkgsToRemove.iterator();
                while (it.hasNext()) {
                    Package pkg = (Package) it.next();
                    XPDLListenerAndObservable xpdllo = getXPDLListenerObservable(pkg);
                    xpdllo.unregisterFromXPDL();
                    xpdlListenerObservables.remove(xpdllo);
                    xpdlh.closePackageVersion(pkg.getId(), pkg.getInternalVersion());
                }
                setChanged();
                notifyObservers(createInfo(mainPkg,
View Full Code Here

                if (canInsert) {
                    xpdlhmain.synchronizePackages(xpdlh);

                    Package realPkg = xpdlhmain.getPackageById(pkg.getId());
                    adjustXPDL(realPkg);
                    XPDLListenerAndObservable xpdl = createNewXPDLListenerObservable(realPkg,
                            false,
                            false);
                    realPkg.setReadOnly(true);
                    xpdl.setModified(false);

                    List pkgsToInsert = new ArrayList();
                    pkgsToInsert.add(realPkg);
                    setChanged();
                    notifyObservers(createInfo(realPkg,
View Full Code Here

    public void removeTransientPackage() {
        XPDLHandler xpdlh = JaWEManager.getInstance().getXPDLHandler();
        Package toRemove = XMLUtil.getPackage(getSelectionManager().getSelectedElement());

        try {
            XPDLListenerAndObservable xpdllo = getXPDLListenerObservable(toRemove);
            xpdllo.unregisterFromXPDL();
            xpdlListenerObservables.remove(xpdllo);
            xpdlh.closePackageVersion(toRemove.getId(), toRemove.getInternalVersion());
            setChanged();
            List pkgsToRemove = new ArrayList();
            pkgsToRemove.add(toRemove);
View Full Code Here

                }
            }

            os.close();

            XPDLListenerAndObservable xpdl = getXPDLListenerObservable(pkg);
            if (xpdl != null) {
                xpdl.setModified(false);
            }

            if (isNewFile) {
                xpdlhandler.registerPackageFilename(filename, pkg);
            }
View Full Code Here

    }

    protected XPDLListenerAndObservable createNewXPDLListenerObservable(Package pkg,
            boolean receiveEvents,
            boolean modified) {
        XPDLListenerAndObservable xpdl = new XPDLListenerAndObservable(pkg, receiveEvents);
        xpdl.setModified(modified);
        xpdlListenerObservables.add(xpdl);
        xpdl.addObserver(this);
        return xpdl;
    }
View Full Code Here

    }

    protected XPDLListenerAndObservable getXPDLListenerObservable(Package pkg) {
        Iterator it = xpdlListenerObservables.iterator();
        while (it.hasNext()) {
            XPDLListenerAndObservable xpdl = (XPDLListenerAndObservable) it.next();
            if (xpdl.getPackage() == pkg) {
                return xpdl;
            }
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of org.enhydra.jawe.XPDLListenerAndObservable

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.