com.infoteria.asteria.flowbuilder2.plugin
クラス PluginUtil

java.lang.Object
  |
  +--com.infoteria.asteria.flowbuilder2.plugin.PluginUtil

public class PluginUtil
extends Object

プラグイン作成で使用するユーティリティメソッド


コンストラクタの概要
PluginUtil()
           
 
メソッドの概要
static boolean deleteFile(String filepath)
          サーバーからファイルを削除します。
static InputStream downloadFile(String filepath)
          サーバーからファイルをダウンロードします。
static JFrame getApplicationFrame()
          デザイナーのメインフレームを返します。
static String[] getConnectionNames(String type)
          現在接続中のサーバーでのコネクション一覧を返します。
static JFileChooser getFileChooser(String initialDir)
          サーバーのファイル選択ダイアログを取得します。
static JFileChooser getFolderChooser(String initialDir)
          サーバーのフォルダ選択ダイアログを取得します。
static com.infoteria.asteria.util.rdb.ColumnInfo[] getTableFields(String dsname, String tblname)
          現在接続中のサーバーでのdsnameとtblnameに対応するテーブルのフィールド一覧を返します。
static String[] getTableNames(String dsname)
          現在接続中のサーバーでのdsnameに対応するコネクションのテーブル一覧を返します。
static File getUserDir()
          ユーザー情報等のファイルを保存するためのディレクトリを返します。
static String normalizeFilePath(File f)
          サーバーから選択したFileオブジェクトのUSER_HOMEからの相対パスを取得します。
static int showConfirm(String msg, int optionType)
          確認メッセージのダイアログを表示します。
static void showError(String msg)
          エラーメッセージのダイアログを表示します。
static void showMessage(String msg)
          情報メッセージのダイアログを表示します。
static void showWarning(String msg)
          警告メッセージのダイアログを表示します。
static UndoableEdit updateCategoryProperty(CategoryProperty dest, CategoryProperty src)
          destのCategoryPropertyにsrcの内容を反映してそのUndo情報を返します。
static void uploadFile(String filepath, File f)
          ローカルにあるファイルをサーバーにアップロードします。
static void uploadTextFile(String filepath, String text, String enc)
          文字列を指定のエンコーディングでサーバーにテキストファイルとしてアップロードします。
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

PluginUtil

public PluginUtil()
メソッドの詳細

getUserDir

public static File getUserDir()
ユーザー情報等のファイルを保存するためのディレクトリを返します。
実際に返されるディレクトリは「OSUSER_HOME/.asteria」です。

getApplicationFrame

public static JFrame getApplicationFrame()
デザイナーのメインフレームを返します。
Dialogを表示する場合の親ウィンドウとして使用できます。

showError

public static void showError(String msg)
エラーメッセージのダイアログを表示します。

showWarning

public static void showWarning(String msg)
警告メッセージのダイアログを表示します。

showMessage

public static void showMessage(String msg)
情報メッセージのダイアログを表示します。

showConfirm

public static int showConfirm(String msg,
                              int optionType)
確認メッセージのダイアログを表示します。
引数のoptionTypeと返り値にはJOptionPaneのoptionTypeを使用します。

updateCategoryProperty

public static UndoableEdit updateCategoryProperty(CategoryProperty dest,
                                                  CategoryProperty src)
destのCategoryPropertyにsrcの内容を反映してそのUndo情報を返します。
destとsrcの内容が同一である場合はnullを返します。

getConnectionNames

public static String[] getConnectionNames(String type)
                                   throws IOException
現在接続中のサーバーでのコネクション一覧を返します。

getTableNames

public static String[] getTableNames(String dsname)
                              throws IOException
現在接続中のサーバーでのdsnameに対応するコネクションのテーブル一覧を返します。

getTableFields

public static com.infoteria.asteria.util.rdb.ColumnInfo[] getTableFields(String dsname,
                                                                         String tblname)
                                                                  throws IOException
現在接続中のサーバーでのdsnameとtblnameに対応するテーブルのフィールド一覧を返します。

uploadFile

public static void uploadFile(String filepath,
                              File f)
                       throws IOException
ローカルにあるファイルをサーバーにアップロードします。

uploadTextFile

public static void uploadTextFile(String filepath,
                                  String text,
                                  String enc)
                           throws IOException
文字列を指定のエンコーディングでサーバーにテキストファイルとしてアップロードします。
パラメータ:
filepath - アップロードするファイルパス。(USER_HOMEからの相対)
text - 文字列
enc - エンコーディング

downloadFile

public static InputStream downloadFile(String filepath)
                                throws IOException
サーバーからファイルをダウンロードします。
パラメータ:
filepath - ダウンロードするファイルパス。(USER_HOMEからの相対)

deleteFile

public static boolean deleteFile(String filepath)
                          throws IOException
サーバーからファイルを削除します。
パラメータ:
filepath - 削除するファイルパス。(USER_HOMEからの相対)

getFileChooser

public static JFileChooser getFileChooser(String initialDir)
                                   throws IOException
サーバーのファイル選択ダイアログを取得します。
パラメータ:
initialDir - 初期ディレクトリ(USER_HOMEからの相対)

getFolderChooser

public static JFileChooser getFolderChooser(String initialDir)
                                     throws IOException
サーバーのフォルダ選択ダイアログを取得します。
パラメータ:
initialDir - 初期ディレクトリ(USER_HOMEからの相対)

normalizeFilePath

public static String normalizeFilePath(File f)
                                throws IOException
サーバーから選択したFileオブジェクトのUSER_HOMEからの相対パスを取得します。