Oxygen XML Editor, Version 14.2

ro.sync.sample.plugin.customprotocol
Class CustomProtocolURLHandlerExtension

java.lang.Object
  extended by ro.sync.sample.plugin.customprotocol.CustomProtocolURLHandlerExtension
All Implemented Interfaces:
PluginExtension, LockHandlerFactoryPluginExtension, URLHandlerReadOnlyCheckerExtension, URLStreamHandlerPluginExtension, URLStreamHandlerPluginExtensionConstants, URLStreamHandlerWithLockPluginExtension

public class CustomProtocolURLHandlerExtension
extends java.lang.Object
implements URLStreamHandlerWithLockPluginExtension, URLHandlerReadOnlyCheckerExtension

Plugin extension - custom protocol URL handler extension


Field Summary
 
Fields inherited from interface ro.sync.exml.plugin.urlstreamhandler.URLStreamHandlerPluginExtensionConstants
ADVICE_CLOSE, ADVICE_RELOAD, LOCATION_HEADER, OXYGEN_ACTION_HEADER
 
Constructor Summary
CustomProtocolURLHandlerExtension()
           
 
Method Summary
 boolean canCheckReadOnly(java.lang.String protocol)
          Returns true if the implementor should be asked about the read-only status for URL's of a certain protocol.
 LockHandler getLockHandler()
          Get the lock handler for the current handled protocol.
 java.net.URLStreamHandler getURLStreamHandler(java.lang.String protocol)
          Gets the handler for the custom protocol
 boolean isLockingSupported(java.lang.String protocol)
          Check if a lock handler can be provided for a specific protocol.
 boolean isReadOnly(java.net.URL url)
          Decide if a given URL is read-only or writable to.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CustomProtocolURLHandlerExtension

public CustomProtocolURLHandlerExtension()
Method Detail

getURLStreamHandler

public java.net.URLStreamHandler getURLStreamHandler(java.lang.String protocol)
Gets the handler for the custom protocol

Specified by:
getURLStreamHandler in interface URLStreamHandlerPluginExtension
Parameters:
protocol - The name of the protocol.
Returns:
The handler for the protocol or null if it does not know it.

getLockHandler

public LockHandler getLockHandler()
Description copied from interface: LockHandlerFactoryPluginExtension
Get the lock handler for the current handled protocol. Might be null if not supported.

Specified by:
getLockHandler in interface LockHandlerFactoryPluginExtension
Returns:
The lock handler for this extension, or null if not supported.
See Also:
LockHandlerFactoryPluginExtension.getLockHandler()

isLockingSupported

public boolean isLockingSupported(java.lang.String protocol)
Description copied from interface: LockHandlerFactoryPluginExtension
Check if a lock handler can be provided for a specific protocol.

Specified by:
isLockingSupported in interface LockHandlerFactoryPluginExtension
Parameters:
protocol - The URL protocol (like "http" or "file")
Returns:
true if this extension can return a lock handler for the protocol.
See Also:
LockHandlerFactoryPluginExtension.isLockingSupported(java.lang.String)

canCheckReadOnly

public boolean canCheckReadOnly(java.lang.String protocol)
Description copied from interface: URLHandlerReadOnlyCheckerExtension
Returns true if the implementor should be asked about the read-only status for URL's of a certain protocol. This call back will usually be received often, each time focus is gained by the current editor.

Specified by:
canCheckReadOnly in interface URLHandlerReadOnlyCheckerExtension
Parameters:
protocol - The URL protocol (like "http" or "file")
Returns:
true if the implementor should be asked about the read-only status for URL's of a certain protocol. For example if you want to decide if "http" URLs are read-only or not you should return true if the protocol is "http" Then, the other callback will be called and you will be able to decide the read-only status for the URL.
See Also:
URLHandlerReadOnlyCheckerExtension.canCheckReadOnly(java.lang.String)

isReadOnly

public boolean isReadOnly(java.net.URL url)
Description copied from interface: URLHandlerReadOnlyCheckerExtension
Decide if a given URL is read-only or writable to. If an URL is marked as read-only Oxygen will present it with a read-only lock icon on the tab. The user will also be able to specify through the user interface that an opened editor over a read-only URL can be edited. Also when saving in Oxygen and the URL is marked as read-only the Save As dialog will be shown instead. This call back will usually be received often, each time focus is gained by the current editor. WARNING: It is advisable to cache the calls for recognized URLs as this method might be called quite often.

Specified by:
isReadOnly in interface URLHandlerReadOnlyCheckerExtension
Parameters:
url - The URL for which the implementor will decide if it is read-only or not.
Returns:
true if a given URL should be regarded by Oxygen as read-only.
See Also:
URLHandlerReadOnlyCheckerExtension.isReadOnly(java.net.URL)

Oxygen XML Editor, Version 14.2

© Copyright Syncro Soft SRL 2002 - 2013. All rights reserved.