Package jadex.base
Class SRemoteGui
- java.lang.Object
-
- jadex.base.SRemoteGui
-
public class SRemoteGui extends java.lang.Object
Helper class for GUI code to be executed on remote devices (e.g. android.).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SRemoteGui.ConsoleListener
-
Constructor Summary
Constructors Constructor Description SRemoteGui()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addConsoleListener(IExternalAccess platformaccess, java.lang.String id, IRemoteChangeListener rcl)
static IFuture<Tuple2<java.net.URL,IResourceIdentifier>>
addRemoteURL(IResourceIdentifier parid, java.lang.String filename, boolean tl, IExternalAccess exta)
Add a remote url via the library service.static IFuture<Tuple2<java.net.URL,IResourceIdentifier>>
addURL(IExternalAccess access, java.lang.String filename)
Add a URL to the lib service.static IIntermediateFuture<FileData>
checkExistence(java.lang.String[] files, IExternalAccess exta)
Check remote files for existence.static IIntermediateFuture<java.lang.String>
convertPathsToRelative(java.lang.String[] paths, IExternalAccess exta)
Convert the given paths to relative paths.static IIntermediateFuture<java.lang.String>
copy(java.lang.String source, IExternalAccess sourceaccess, java.lang.String target, IFileTransferService targetds)
Copy a file between two platforms.static IFuture<IResourceIdentifier>
createResourceIdentifier(IExternalAccess platformaccess, java.lang.String ridurl, java.lang.String globalrid)
Create a resource identifier.static IFuture<java.lang.Integer>
findChild(IExternalAccess access, java.lang.String toremove, java.util.List<java.lang.String> filenames)
Find an entry in a list of URLs.static IFuture<FileData>
getFileData(IExternalAccess platformaccess, java.lang.String path)
Get the file info of a remote path.static IFuture<java.lang.Object[]>
getServiceInfos(IExternalAccess ea)
Get the service infos for a component.static boolean
isComponentStepNecessary(IComponentIdentifier target)
Check if a component is necessary.static IFuture<java.lang.Boolean>
isTestcase(java.lang.String model, IExternalAccess access, IResourceIdentifier rid)
Check if a component model can be started as test case.static IIntermediateFuture<FileData>
listFiles(FileData dir, IAsyncFilter filter)
List files in a directory matching a filter (if any).static IIntermediateFuture<FileData>
listFiles(FileData dir, IAsyncFilter filter, IExternalAccess exta)
List files in a directory matching a filter (if any).static ISubscriptionIntermediateFuture<FileData>
listJarFileEntries(FileData file, IAsyncFilter filter)
List files of a remote jar filestatic ISubscriptionIntermediateFuture<FileData>
listJarFileEntries(FileData file, IAsyncFilter filter, IExternalAccess exta)
List files in a directory matching a filter (if any).static IFuture<Tuple2<java.lang.String,java.lang.String>>
localizeModel(IExternalAccess platformaccess, java.lang.String name, IResourceIdentifier rid)
Localize a model name.static IFuture<java.lang.Void>
logWarning(java.lang.String msg, IExternalAccess exta)
Log a warning on a component.static IFuture<java.lang.Boolean>
matchModel(java.lang.String path, java.lang.String model, IExternalAccess exta)
Compare a model to a path.static IFuture<java.util.Map<java.lang.String,java.lang.Object>>
parseArgs(java.util.Map<java.lang.String,java.lang.String> rawargs, IResourceIdentifier modelrid, IExternalAccess exta)
static void
redirectInput(IExternalAccess access, java.lang.String txt)
Redirect some text to the remote input stream.static void
removeConsoleListener(IExternalAccess platformaccess, java.lang.String id)
static IFuture<java.lang.Void>
removeURL(IExternalAccess access, java.lang.String path)
Remove a URL from the lib service.
-
-
-
Method Detail
-
isComponentStepNecessary
public static boolean isComponentStepNecessary(IComponentIdentifier target)
Check if a component is necessary.- Parameters:
target
- The target component identifier.- Returns:
- The
-
getServiceInfos
public static IFuture<java.lang.Object[]> getServiceInfos(IExternalAccess ea)
Get the service infos for a component.- Parameters:
ea
- The component access.- Returns:
- The provided and required service infos.
-
localizeModel
public static IFuture<Tuple2<java.lang.String,java.lang.String>> localizeModel(IExternalAccess platformaccess, java.lang.String name, IResourceIdentifier rid)
Localize a model name. The result can be e.g. used to save settings.- Returns:
- A tuple with the relative local model name and the relative local RID URL.
-
createResourceIdentifier
public static IFuture<IResourceIdentifier> createResourceIdentifier(IExternalAccess platformaccess, java.lang.String ridurl, java.lang.String globalrid)
Create a resource identifier.- Parameters:
ridurl
- The (possibly relative) local RID URL.globalrid
- The global RID, if any.- Returns:
- A valid RID for the platform.
-
getFileData
public static IFuture<FileData> getFileData(IExternalAccess platformaccess, java.lang.String path)
Get the file info of a remote path.
-
addURL
public static IFuture<Tuple2<java.net.URL,IResourceIdentifier>> addURL(IExternalAccess access, java.lang.String filename)
Add a URL to the lib service.
-
removeURL
public static IFuture<java.lang.Void> removeURL(IExternalAccess access, java.lang.String path)
Remove a URL from the lib service.
-
findChild
public static IFuture<java.lang.Integer> findChild(IExternalAccess access, java.lang.String toremove, java.util.List<java.lang.String> filenames)
Find an entry in a list of URLs. Tests canonical paths on the remote system.
-
checkExistence
public static IIntermediateFuture<FileData> checkExistence(java.lang.String[] files, IExternalAccess exta)
Check remote files for existence.- Parameters:
files
- The files to check.- Returns:
- All checked files that exist.
-
convertPathsToRelative
public static IIntermediateFuture<java.lang.String> convertPathsToRelative(java.lang.String[] paths, IExternalAccess exta)
Convert the given paths to relative paths.- Parameters:
paths
- The paths- Returns:
- The relative paths.
-
listFiles
public static IIntermediateFuture<FileData> listFiles(FileData dir, IAsyncFilter filter, IExternalAccess exta)
List files in a directory matching a filter (if any).- Parameters:
dir
- The directory.filter
- The filter or null for all files.
-
listFiles
public static IIntermediateFuture<FileData> listFiles(FileData dir, IAsyncFilter filter)
List files in a directory matching a filter (if any).- Parameters:
dir
- The directory.filter
- The filter or null for all files.
-
listJarFileEntries
public static ISubscriptionIntermediateFuture<FileData> listJarFileEntries(FileData file, IAsyncFilter filter, IExternalAccess exta)
List files in a directory matching a filter (if any).- Parameters:
dir
- The directory.filter
- The filter or null for all files.
-
listJarFileEntries
public static ISubscriptionIntermediateFuture<FileData> listJarFileEntries(FileData file, IAsyncFilter filter)
List files of a remote jar file
-
isTestcase
public static IFuture<java.lang.Boolean> isTestcase(java.lang.String model, IExternalAccess access, IResourceIdentifier rid)
Check if a component model can be started as test case.
-
parseArgs
public static IFuture<java.util.Map<java.lang.String,java.lang.Object>> parseArgs(java.util.Map<java.lang.String,java.lang.String> rawargs, IResourceIdentifier modelrid, IExternalAccess exta)
-
addRemoteURL
public static IFuture<Tuple2<java.net.URL,IResourceIdentifier>> addRemoteURL(IResourceIdentifier parid, java.lang.String filename, boolean tl, IExternalAccess exta)
Add a remote url via the library service. Needs to schedule on target platform to recreate url.
-
copy
public static IIntermediateFuture<java.lang.String> copy(java.lang.String source, IExternalAccess sourceaccess, java.lang.String target, IFileTransferService targetds)
Copy a file between two platforms. Intermediate results represent status messages.
-
matchModel
public static IFuture<java.lang.Boolean> matchModel(java.lang.String path, java.lang.String model, IExternalAccess exta)
Compare a model to a path.
-
logWarning
public static IFuture<java.lang.Void> logWarning(java.lang.String msg, IExternalAccess exta)
Log a warning on a component.
-
redirectInput
public static void redirectInput(IExternalAccess access, java.lang.String txt)
Redirect some text to the remote input stream.
-
addConsoleListener
public static void addConsoleListener(IExternalAccess platformaccess, java.lang.String id, IRemoteChangeListener rcl)
-
removeConsoleListener
public static void removeConsoleListener(IExternalAccess platformaccess, java.lang.String id)
-
-