|
From: <fd...@us...> - 2007-04-15 18:18:00
|
Revision: 3160
http://jnode.svn.sourceforge.net/jnode/?rev=3160&view=rev
Author: fduminy
Date: 2007-04-15 11:17:56 -0700 (Sun, 15 Apr 2007)
Log Message:
-----------
update of JPartition : refactor around stamps-mvc for better separation
of model, view and controller
Added Paths:
-----------
trunk/distr/src/apps/org/jnode/apps/jpartition/ViewFactory.java
trunk/distr/src/apps/org/jnode/apps/jpartition/commands/
trunk/distr/src/apps/org/jnode/apps/jpartition/commands/BaseDeviceCommand.java
trunk/distr/src/apps/org/jnode/apps/jpartition/commands/InitMbrCommand.java
trunk/distr/src/apps/org/jnode/apps/jpartition/commands/framework/
trunk/distr/src/apps/org/jnode/apps/jpartition/commands/framework/CommandProcessorListener.java
Added: trunk/distr/src/apps/org/jnode/apps/jpartition/ViewFactory.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/jpartition/ViewFactory.java (rev 0)
+++ trunk/distr/src/apps/org/jnode/apps/jpartition/ViewFactory.java 2007-04-15 18:17:56 UTC (rev 3160)
@@ -0,0 +1,12 @@
+package org.jnode.apps.jpartition;
+
+import org.jnode.apps.jpartition.controller.MainController;
+
+public interface ViewFactory {
+ Object createDeviceView(MainController controller, Object fileDeviceView,
+ Object cmdProcessorView) throws Exception;
+
+ Object createFileDeviceView(MainController controller) throws Exception;
+
+ Object createCommandProcessorView(MainController mainController);
+}
Added: trunk/distr/src/apps/org/jnode/apps/jpartition/commands/BaseDeviceCommand.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/jpartition/commands/BaseDeviceCommand.java (rev 0)
+++ trunk/distr/src/apps/org/jnode/apps/jpartition/commands/BaseDeviceCommand.java 2007-04-15 18:17:56 UTC (rev 3160)
@@ -0,0 +1,23 @@
+package org.jnode.apps.jpartition.commands;
+
+import org.jnode.apps.jpartition.commands.framework.BaseCommand;
+import org.jnode.apps.jpartition.commands.framework.CommandException;
+import org.jnode.driver.bus.ide.IDEDevice;
+import org.jnode.partitions.command.FdiskCommand;
+
+abstract public class BaseDeviceCommand extends BaseCommand {
+ protected final IDEDevice device;
+
+ public BaseDeviceCommand(String name, IDEDevice device)
+ {
+ super(name);
+ this.device = device;
+ }
+
+ abstract protected void doExecute() throws CommandException;
+
+ @Override
+ public String toString() {
+ return super.toString() + " - " + device.getId();
+ }
+}
Added: trunk/distr/src/apps/org/jnode/apps/jpartition/commands/InitMbrCommand.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/jpartition/commands/InitMbrCommand.java (rev 0)
+++ trunk/distr/src/apps/org/jnode/apps/jpartition/commands/InitMbrCommand.java 2007-04-15 18:17:56 UTC (rev 3160)
@@ -0,0 +1,23 @@
+package org.jnode.apps.jpartition.commands;
+
+import org.jnode.apps.jpartition.commands.framework.CommandException;
+import org.jnode.driver.bus.ide.IDEDevice;
+import org.jnode.partitions.command.PartitionHelper;
+
+public class InitMbrCommand extends BaseDeviceCommand {
+
+ public InitMbrCommand(IDEDevice device) {
+ super("init MBR", device);
+ }
+
+ @Override
+ protected void doExecute() throws CommandException {
+ PartitionHelper helper;
+ try {
+ helper = new PartitionHelper(device);
+ helper.initMbr();
+ } catch (Throwable t) {
+ throw new CommandException(t);
+ }
+ }
+}
Added: trunk/distr/src/apps/org/jnode/apps/jpartition/commands/framework/CommandProcessorListener.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/jpartition/commands/framework/CommandProcessorListener.java (rev 0)
+++ trunk/distr/src/apps/org/jnode/apps/jpartition/commands/framework/CommandProcessorListener.java 2007-04-15 18:17:56 UTC (rev 3160)
@@ -0,0 +1,8 @@
+package org.jnode.apps.jpartition.commands.framework;
+
+public interface CommandProcessorListener {
+ void commandAdded(CommandProcessor processor, Command command);
+ void commandRemoved(CommandProcessor processor, Command command);
+ void commandStarted(CommandProcessor processor, Command command);
+ void commandFinished(CommandProcessor processor, Command command);
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|