csdk.v1_0.helper
Class AbstractCSDKApplication

java.lang.Object
  extended by csdk.v1_0.helper.application.AbstractApplication
      extended by csdk.v1_0.helper.AbstractCSDKApplication
All Implemented Interfaces:
IApplication, IApplicationContext, ICommandContext, IContext, ICSDKEnvironment, ILocalFileSystemContext, IProjectContext, Serializable
Direct Known Subclasses:
AbstractCSDKWindowApplication

public abstract class AbstractCSDKApplication
extends AbstractApplication
implements IProjectContext, ILocalFileSystemContext, ICommandContext

Classe abstrata para facilitar o desenvolvimento de aplicações que acessam a área de projetos com CSDK.

See Also:
Serialized Form

Constructor Summary
AbstractCSDKApplication(ICSDKEnvironment csdkInterface)
          Construtor.
 
Method Summary
 void addProjectObserver(IProjectObserver observer)
          
 IFile browseLocalFileInOpenMode(String[] fileTypes, boolean allowAll, IFile currentDir, FileSelectionType fileSelectionType, Window frame)
          
 IFile browseLocalFileInSaveMode(String[] fileTypes, boolean allowAll, String defaultName, IFile currentDir, Window frame)
          
 IFile[] browseMultipleLocalFilesInOpenMode(String[] fileTypes, boolean allowAll, IFile currentDir, FileSelectionType fileSelectionType, Window frame)
          
 IFile[] browseMultipleProjectFilesInOpenMode(String[] fileTypes, boolean allowAll, FileSelectionType selectionType, Window frame)
          
 IFile browseProjectFileInOpenMode(String[] fileTypes, boolean allowAll, FileSelectionType selectionType, Window frame)
          
 IFile browseProjectFileInSaveMode(String[] fileTypes, boolean allowAll, String defaultName, Window frame)
          
 IFile createLocalFile(String[] path, String name, boolean isDir)
          
 IFile createProjectFile(String[] path, String name, String fileType, Window window)
          
protected  void disposeContexts()
          Limpa as referências para os contextos.
 String executeAlgorithm(IAlgorithmTemplate info, String description, String sgaServerName, Window owner, ICommandObserver observer)
          
 String executeFlow(IFlowTemplate info, String description, String sgaServerName, Window owner, ICommandObserver observer)
          
 String getCurrentProjectId()
          
 IFile getLocalFile(String[] path)
          
 IFile getProjectFile(String[] path, Window window)
          
 boolean isCommandContextAvailable()
          Indica se o contexto de execução de comandos está disponível.
 boolean isFileSystemContextAvailable()
          Indica se o contexto de sistema de arquivo está disponível.
 boolean isProjectContextAvailable()
          Indica se o contexto de projetos está disponível.
 boolean isProjectOpen()
          Verifica se existe projeto corrente.
 boolean removeLocalFile(String[] path)
          
 boolean removeProjectFile(String[] path, Window window)
          
 void removeProjectObserver(IProjectObserver observer)
          
 
Methods inherited from class csdk.v1_0.helper.application.AbstractApplication
canEndApplication, finishApplication, getApplicationDescription, getApplicationFileTypes, getApplicationIcon, getApplicationId, getApplicationName, getAuthor, getAuthorEmail, getCharset, getClassString, getContext, getImageIcon, getInstanceId, getLocale, getProperty, getServerCharset, getSmallApplicationIcon, getString, getVersion, handleException, hasClassString, hasString, isActive, isApplicationContextAvailable, isBundleRequired, isPropertyNull, isSingleton, onApplicationEnd, onContextActivate, onContextDeactivate, onMessageReceived, requiresProject, runApplication, sendMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface csdk.v1_0.api.core.IContext
isActive, onContextActivate, onContextDeactivate
 
Methods inherited from interface csdk.v1_0.api.application.IApplication
onApplicationStart
 

Constructor Detail

AbstractCSDKApplication

public AbstractCSDKApplication(ICSDKEnvironment csdkInterface)
Construtor.

Parameters:
csdkInterface - interface padrão para o ambiente CSDK.
Method Detail

browseProjectFileInOpenMode

public final IFile browseProjectFileInOpenMode(String[] fileTypes,
                                               boolean allowAll,
                                               FileSelectionType selectionType,
                                               Window frame)
                                        throws ProjectException

Specified by:
browseProjectFileInOpenMode in interface IProjectContext
Throws:
ProjectException

browseMultipleProjectFilesInOpenMode

public IFile[] browseMultipleProjectFilesInOpenMode(String[] fileTypes,
                                                    boolean allowAll,
                                                    FileSelectionType selectionType,
                                                    Window frame)
                                             throws ProjectException

Specified by:
browseMultipleProjectFilesInOpenMode in interface IProjectContext
Throws:
ProjectException

browseProjectFileInSaveMode

public final IFile browseProjectFileInSaveMode(String[] fileTypes,
                                               boolean allowAll,
                                               String defaultName,
                                               Window frame)
                                        throws ProjectException

Specified by:
browseProjectFileInSaveMode in interface IProjectContext
Throws:
ProjectException

getProjectFile

public final IFile getProjectFile(String[] path,
                                  Window window)
                           throws ProjectException

Specified by:
getProjectFile in interface IProjectContext
Throws:
ProjectException

createProjectFile

public final IFile createProjectFile(String[] path,
                                     String name,
                                     String fileType,
                                     Window window)
                              throws ProjectException

Specified by:
createProjectFile in interface IProjectContext
Throws:
ProjectException

getCurrentProjectId

public final String getCurrentProjectId()

Specified by:
getCurrentProjectId in interface IProjectContext

addProjectObserver

public void addProjectObserver(IProjectObserver observer)

Specified by:
addProjectObserver in interface IProjectContext

removeProjectObserver

public void removeProjectObserver(IProjectObserver observer)

Specified by:
removeProjectObserver in interface IProjectContext

removeProjectFile

public boolean removeProjectFile(String[] path,
                                 Window window)
                          throws ProjectException

Specified by:
removeProjectFile in interface IProjectContext
Throws:
ProjectException

browseLocalFileInOpenMode

public final IFile browseLocalFileInOpenMode(String[] fileTypes,
                                             boolean allowAll,
                                             IFile currentDir,
                                             FileSelectionType fileSelectionType,
                                             Window frame)
                                      throws LocalFileSystemException

Specified by:
browseLocalFileInOpenMode in interface ILocalFileSystemContext
Throws:
LocalFileSystemException

browseMultipleLocalFilesInOpenMode

public IFile[] browseMultipleLocalFilesInOpenMode(String[] fileTypes,
                                                  boolean allowAll,
                                                  IFile currentDir,
                                                  FileSelectionType fileSelectionType,
                                                  Window frame)
                                           throws LocalFileSystemException

Specified by:
browseMultipleLocalFilesInOpenMode in interface ILocalFileSystemContext
Throws:
LocalFileSystemException

browseLocalFileInSaveMode

public final IFile browseLocalFileInSaveMode(String[] fileTypes,
                                             boolean allowAll,
                                             String defaultName,
                                             IFile currentDir,
                                             Window frame)
                                      throws LocalFileSystemException

Specified by:
browseLocalFileInSaveMode in interface ILocalFileSystemContext
Throws:
LocalFileSystemException

getLocalFile

public IFile getLocalFile(String[] path)
                   throws LocalFileSystemException

Specified by:
getLocalFile in interface ILocalFileSystemContext
Throws:
LocalFileSystemException

createLocalFile

public final IFile createLocalFile(String[] path,
                                   String name,
                                   boolean isDir)
                            throws LocalFileSystemException

Specified by:
createLocalFile in interface ILocalFileSystemContext
Throws:
LocalFileSystemException

removeLocalFile

public boolean removeLocalFile(String[] path)
                        throws LocalFileSystemException

Specified by:
removeLocalFile in interface ILocalFileSystemContext
Throws:
LocalFileSystemException

executeAlgorithm

public final String executeAlgorithm(IAlgorithmTemplate info,
                                     String description,
                                     String sgaServerName,
                                     Window owner,
                                     ICommandObserver observer)
                              throws CommandException

Specified by:
executeAlgorithm in interface ICommandContext
Throws:
CommandException

executeFlow

public final String executeFlow(IFlowTemplate info,
                                String description,
                                String sgaServerName,
                                Window owner,
                                ICommandObserver observer)
                         throws CommandException

Specified by:
executeFlow in interface ICommandContext
Throws:
CommandException

isProjectContextAvailable

public boolean isProjectContextAvailable()
Indica se o contexto de projetos está disponível.

Returns:
true se o contexto estiver disponível ou false caso contrário.

isProjectOpen

public boolean isProjectOpen()
Verifica se existe projeto corrente.

Returns:
true caso exista um projeto aberto ou false caso contrário.

isFileSystemContextAvailable

public boolean isFileSystemContextAvailable()
Indica se o contexto de sistema de arquivo está disponível.

Returns:
true se o contexto estiver disponível ou false caso contrário.

isCommandContextAvailable

public boolean isCommandContextAvailable()
Indica se o contexto de execução de comandos está disponível.

Returns:
true se o contexto estiver disponível ou false caso contrário.

disposeContexts

protected void disposeContexts()
Limpa as referências para os contextos.

Overrides:
disposeContexts in class AbstractApplication


Copyright © 2013–2014 Tecgraf/PUC-Rio. All rights reserved.