Search in sources :

Example 6 with XmlAttributes

use of com.mucommander.commons.util.xml.XmlAttributes in project mucommander by mucommander.

the class BookmarkWriter method startBookmarks.

public void startBookmarks() throws BookmarkException {
    // Root element
    try {
        // Version the file.
        // Note: the version attribute was introduced in muCommander 0.8.4.
        XmlAttributes attributes = new XmlAttributes();
        attributes.add("version", RuntimeConstants.VERSION);
        out.startElement(ELEMENT_ROOT, attributes);
        out.println();
    } catch (IOException e) {
        throw new BookmarkException(e);
    }
}
Also used : XmlAttributes(com.mucommander.commons.util.xml.XmlAttributes) IOException(java.io.IOException)

Example 7 with XmlAttributes

use of com.mucommander.commons.util.xml.XmlAttributes in project mucommander by mucommander.

the class AssociationWriter method setIsReadable.

public void setIsReadable(boolean isReadable) throws CommandException {
    XmlAttributes attr;
    attr = new XmlAttributes();
    attr.add(ATTRIBUTE_VALUE, isReadable ? VALUE_TRUE : VALUE_FALSE);
    try {
        out.writeStandAloneElement(ELEMENT_IS_READABLE, attr);
    } catch (IOException e) {
        throw new CommandException(e);
    }
}
Also used : XmlAttributes(com.mucommander.commons.util.xml.XmlAttributes) IOException(java.io.IOException)

Example 8 with XmlAttributes

use of com.mucommander.commons.util.xml.XmlAttributes in project mucommander by mucommander.

the class AssociationWriter method startAssociation.

public void startAssociation(String command) throws CommandException {
    XmlAttributes attr;
    attr = new XmlAttributes();
    attr.add(ATTRIBUTE_COMMAND, command);
    try {
        out.startElement(ELEMENT_ASSOCIATION, attr);
        out.println();
    } catch (IOException e) {
        throw new CommandException(e);
    }
}
Also used : XmlAttributes(com.mucommander.commons.util.xml.XmlAttributes) IOException(java.io.IOException)

Example 9 with XmlAttributes

use of com.mucommander.commons.util.xml.XmlAttributes in project mucommander by mucommander.

the class AssociationWriter method setMask.

public void setMask(String mask, boolean isCaseSensitive) throws CommandException {
    XmlAttributes attr;
    attr = new XmlAttributes();
    attr.add(ATTRIBUTE_VALUE, mask);
    if (!isCaseSensitive)
        attr.add(ATTRIBUTE_CASE_SENSITIVE, VALUE_FALSE);
    try {
        out.writeStandAloneElement(ELEMENT_MASK, attr);
    } catch (IOException e) {
        throw new CommandException(e);
    }
}
Also used : XmlAttributes(com.mucommander.commons.util.xml.XmlAttributes) IOException(java.io.IOException)

Example 10 with XmlAttributes

use of com.mucommander.commons.util.xml.XmlAttributes in project mucommander by mucommander.

the class AssociationWriter method setIsExecutable.

public void setIsExecutable(boolean isExecutable) throws CommandException {
    XmlAttributes attr;
    attr = new XmlAttributes();
    attr.add(ATTRIBUTE_VALUE, isExecutable ? VALUE_TRUE : VALUE_FALSE);
    try {
        out.writeStandAloneElement(ELEMENT_IS_EXECUTABLE, attr);
    } catch (IOException e) {
        throw new CommandException(e);
    }
}
Also used : XmlAttributes(com.mucommander.commons.util.xml.XmlAttributes) IOException(java.io.IOException)

Aggregations

XmlAttributes (com.mucommander.commons.util.xml.XmlAttributes)13 IOException (java.io.IOException)9 XmlWriter (com.mucommander.commons.util.xml.XmlWriter)2 Credentials (com.mucommander.commons.file.Credentials)1 FileURL (com.mucommander.commons.file.FileURL)1