Pluggable JXTaskPane

http://blogs.oracle.com/geertjan/entry/pluggable_jxtaskpane

——————————————————————————————————————————————————————————————

 

Pluggable JXTaskPane

By Geertjan on May 21, 2010
Some of the students on the recent NetBeans Platform Certified Training at the TU Braunschweig are creating an application in the medical domain. I was shown their application, which included a JXTaskPane from the SwingX project.

Each task in the task pane represents a different department at the hospital. E.g., one task for "Anamnesis" and another task for "Radiology", each with their own labels, icons, and actions. So then, I stated, it would be completely logical for each task to be provided by a different module since each module could then more easily be created by different departments, the application could be created for different users, and the users themselves could potentially have a choice in the features available in their local distribution. Today I experimented with this scenario. And, as you can see, my medical application has one module that displays tasks, with supporting modules coming from each department in the hospital (currently two only for demo purposes):

To the end user, there's no difference, of course, since the UI is the same regardless of whether the application is modular or not:

In the TaskDisplayer module, I have a TopComponent with the following added to the constructor:

//Read the "tasks" folder in the layer file via the NetBeans Filesystems API: FileObject tasksFolder = FileUtil.getConfigFile("tasks"); //Get all the children, which represent tasks: FileObject[] tasks = tasksFolder.getChildren();  //Create a JXTaskPaneContainer: JXTaskPaneContainer taskpanecontainer = new JXTaskPaneContainer();  //Create the JXPanel: JXPanel panel = new JXPanel(); panel.setLayout(new BorderLayout());  //Iterate through the tasks in the order //specified by the "position" attribute: for (FileObject task : FileUtil.getOrder(Arrays.asList(tasks), true)) {      String name = task.getName();     String room = task.getAttribute("location").toString();      //Create a new JXTaskPane     //for each task:     JXTaskPane taskpane = new JXTaskPane();     taskpane.setTitle(name + " (" + room + ")");      //Add Actions registered in the layer:     List<? extends Action> actions = Utilities.actionsForPath("Actions/" + name);     for (Action action : actions) {         taskpane.add(action);     }      //Add the JXTaskPane to the JXTaskPaneContainer:     taskpanecontainer.add(taskpane);  }  //Add the JXTaskPaneContainer to the JXTaskPanel: panel.setAlpha(0.7f); panel.add(taskpanecontainer, BorderLayout.CENTER); panel.setPreferredSize(new Dimension(250, 200));  //Add the JXTaskPanel to the TopComponent: add(panel, BorderLayout.CENTER);

And then, in each module for the departments, I have content like this in the layer file, which is what is read by the code above:

<folder name="tasks">     <folder name="Radiology">         <attr name="location" stringvalue="Sector 3B"/>         <attr name="position" intvalue="200"/>     </folder> </folder>  <folder name="Actions">     <folder name="Radiology">         <file name="org-medical-task-radiology-AnalyzeAction.instance">             <attr name="delegate" newvalue="org.medical.task.radiology.AnalyzeAction"/>             <attr name="displayName" bundlevalue="org.medical.task.radiology.Bundle#CTL_AnalyzeAction"/>             <attr name="instanceCreate" methodvalue="org.openide.awt.Actions.alwaysEnabled"/>             <attr name="noIconInMenu" boolvalue="false"/>             <attr name="position" intvalue="200"/>         </file>         <file name="org-medical-task-radiology-ScanAction.instance">             <attr name="delegate" newvalue="org.medical.task.radiology.ScanAction"/>             <attr name="displayName" bundlevalue="org.medical.task.radiology.Bundle#CTL_ScanAction"/>             <attr name="instanceCreate" methodvalue="org.openide.awt.Actions.alwaysEnabled"/>             <attr name="noIconInMenu" boolvalue="false"/>             <attr name="position" intvalue="100"/>         </file>     </folder> </folder>

Finally, it would even be possible to make supplemental tasks available depending on the actions selected in the tasks above. I.e., the "Radiology" task would only be added once "Assess Symptoms" has been completed in the "Anamnesis" task. To really optimize performance, you could load a module on demand, i.e., only load the "Radiology" module at the time that that module becomes relevant.

And, to make the solution even better, each task could be created from a Node, meaning that each task would then have its own context (i.e., its own Lookup), so that it could be context sensitive, i.e, depending on the current patient (a Patient POJO in the Lookup), different capabilities could be made available.

In other news. For more on NetBeans Platform in the medical domain, read Interview: NetBeans Platform Helps Advance Biomechanics Research, which was published today.

转载于:https://www.cnblogs.com/cuizhf/archive/2011/11/03/2234349.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: 将11g数据库还原到12c可通过以下步骤完成: 1. 首先,创建一个新的12c数据库,确保数据库版本与12c兼容,并确保已正确安装12c数据库软件。 2. 使用RMAN(恢复管理器)进行备份:在11g数据库中,使用RMAN执行完整备份以将数据库备份到外部介质(如磁盘、磁带等)。确保备份文件包含数据库的所有数据文件、控制文件和参数文件。 3. 将备份文件复制到12c数据库服务器。可以使用文件传输工具(如scp、ftp等)将备份文件转移到12c数据库服务器。 4. 在12c数据库服务器上使用RMAN恢复备份:启动12c数据库实例,然后连接到RMAN命令行界面,通过指定11g备份文件的位置和名称来恢复11g数据库。 5. 确保12c数据库实例正常运行,并且数据库文件正确还原。验证数据库文件是否完整,以及是否可以正常访问。 6. 针对每个需要还原的11g pluggable database,创建一个新的12c可插件数据库。使用Oracle Database Configuration Assistant(DBCA)工具创建新的12c pluggable database实例。 7. 在12c pluggable database的新实例上通过导入工具导入11g pluggable database的数据。使用Oracle Data Pump或其他适用的工具将11g pluggable database的数据导入到新的12c pluggable database中。 8. 验证还原和导入的数据:确保数据的完整性和一致性,验证所有表、视图和其他对象是否正确还原。 9. 执行必要的后续步骤:根据需要,执行必要的配置、设置和更新,以确保12c pluggable database与原始11g数据库一致。 请注意,以上步骤仅提供了一个基本的概述,实际操作可能会因数据库的特定要求而有所差异。在执行此过程时,请确保了解您的环境,并参考相关文档和指南。 ### 回答2: 将Oracle 11g还原到Oracle 12c可插拔数据库的过程相对比较简单,下面我会用300字中文来解释该过程。 首先,我们需要使用Oracle Database 12c的安装介质来安装一个12c的Oracle实例。你可以选择将该实例安装为容器数据库(CDB)或非容器数据库(非CDB),取决于你的需求。 接下来,使用RMAN(Oracle的备份恢复管理工具)来备份你的Oracle 11g数据库。确保备份包含了你想要恢复的所有文件,如数据文件、控制文件、归档日志等。 在12c数据库上创建一个新的容器数据库(CDB)。你可以使用创建数据库语句(CREATE DATABASE)或使用数据库配置助手(Database Configuration Assistant)来完成这个任务。 创建容器数据库后,创建一个新的可插拔数据库(PDB)。你可以使用“CREATE PLUGGABLE DATABASE”语句来创建一个空的PDB。 在创建PDB之后,使用RMAN来还原11g数据库。使用RMAN的RESTORE命令来还原数据文件、控制文件和归档日志等文件到指定的位置。 完成还原后,将还原的数据文件和控制文件复制到PDB的目录中。你可以使用操作系统的命令或者文件管理器来完成这个任务。 最后,通过ALTER PLUGGABLE DATABASE语句将PDB打开,使其可供访问。这样就完成了将11g还原到12c可插拔数据库的过程。 需要注意的是,在还原的过程中可能会遇到一些问题,比如版本不兼容或者数据不一致等。为了保证还原的成功,建议在还原之前先仔细阅读Oracle官方文档,确保你了解该过程的每一个步骤和相关的注意事项。 ### 回答3: 要将11g数据库还原到12c可插拔数据库,以下是操作步骤: 1. 首先,确保已经安装了12c数据库软件,并且已经创建了一个空的12c可插拔数据库实例。 2. 在11g数据库中执行数据泵导出操作,将数据和对象导出到一个数据泵文件中。可以使用expdp命令来执行导出操作。示例命令如下: ``` expdp system/password@source_db directory=data_pump_dir dumpfile=export.dmp logfile=export.log full=y ``` 这将导出整个11g数据库的内容到一个名为export.dmp的数据泵文件中。 3. 将导出的数据泵文件复制到12c数据库服务器上,并确保数据库服务器具有适当的读取权限。 4. 在12c数据库中执行数据泵导入操作,导入从11g数据库中导出的数据。可以使用impdp命令来执行导入操作。示例命令如下: ``` impdp system/password@target_db directory=data_pump_dir dumpfile=export.dmp logfile=import.log remap_schema=source_schema:target_schema ``` 这将从export.dmp文件中导入数据到12c数据库。`source_schema`是11g数据库中的架构名称,`target_schema`是12c数据库中的目标架构名称。使用remap_schema参数可以将导入的对象重定向到新的架构中。 5. 在导入完成后,可以验证数据是否成功导入到12c可插拔数据库中。可以查询表数据,检查是否与11g数据库中相同。 通过以上步骤,您可以将11g数据库还原到12c可插拔数据库中,并且可以在12c数据库中使用先前导出的数据和对象。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值