|
From: <fd...@us...> - 2007-04-15 21:17:18
|
Revision: 3164
http://jnode.svn.sourceforge.net/jnode/?rev=3164&view=rev
Author: fduminy
Date: 2007-04-15 14:17:16 -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/swingview/
trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/CommandProcessorView.java
trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/DeviceView.java
trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/DiskAreaView.java
trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/ErrorReporter.java
trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/FileDeviceView.java
trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/MainView.java
trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/PartitionView.java
trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/SwingViewFactory.java
trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/actions/
trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/actions/BaseDeviceAction.java
trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/actions/InitMbrAction.java
Added: trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/CommandProcessorView.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/CommandProcessorView.java (rev 0)
+++ trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/CommandProcessorView.java 2007-04-15 21:17:16 UTC (rev 3164)
@@ -0,0 +1,82 @@
+package org.jnode.apps.jpartition.swingview;
+
+import it.battlehorse.stamps.annotations.ModelDependent;
+
+import java.awt.BorderLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.BorderFactory;
+import javax.swing.DefaultListModel;
+import javax.swing.JButton;
+import javax.swing.JList;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+
+import org.apache.log4j.Logger;
+import org.jnode.apps.jpartition.controller.MainController;
+
+public class CommandProcessorView extends JPanel
+{
+ private static final Logger log = Logger.getLogger(CommandProcessorView.class);
+
+ private MainController controller;
+
+ private DefaultListModel commands = new DefaultListModel();
+ private JList commandsUI = new JList(commands);
+ private JButton btnApply = new JButton("Apply");
+
+ public CommandProcessorView(MainController controller)
+ {
+ this.controller = controller;
+
+ setBorder(BorderFactory.createTitledBorder("pending commands"));
+
+ JPanel btnPanel = new JPanel(new BorderLayout());
+ btnPanel.add(btnApply, BorderLayout.NORTH);
+
+ JPanel panel = new JPanel(new BorderLayout());
+ panel.add(btnPanel, BorderLayout.EAST);
+ panel.add(new JScrollPane(commandsUI), BorderLayout.CENTER);
+ add(panel);
+
+ btnApply.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent ae_) {
+ CommandProcessorView.this.setEnabled(false);
+ CommandProcessorView.this.controller.userProcessCommands();
+ }
+ });
+ }
+
+ @ModelDependent(modelKey ="CommandProcessorModel" , propertyKey = "commandsProcessed")
+ public void commandsProcessed(Object command) {
+ setEnabled(true);
+ }
+
+ @ModelDependent(modelKey ="CommandProcessorModel" , propertyKey = "commandAdded")
+ public void commandAdded(Object command) {
+ commands.addElement(command);
+ }
+
+ @ModelDependent(modelKey ="CommandProcessorModel" , propertyKey = "commandStarted")
+ public void commandStarted(Object command) {
+ refreshCommand(command);
+ }
+
+ @ModelDependent(modelKey ="CommandProcessorModel" , propertyKey = "commandFinished")
+ public void commandFinished(Object command) {
+ refreshCommand(command);
+ }
+
+ @ModelDependent(modelKey ="CommandProcessorModel" , propertyKey = "commandRemoved")
+ public void commandRemoved(Object command) {
+ commands.removeElement(command);
+ }
+
+ protected void refreshCommand(Object command)
+ {
+ int index = commands.indexOf(command);
+ commands.set(index, command);
+ }
+}
Added: trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/DeviceView.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/DeviceView.java (rev 0)
+++ trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/DeviceView.java 2007-04-15 21:17:16 UTC (rev 3164)
@@ -0,0 +1,96 @@
+package org.jnode.apps.jpartition.swingview;
+
+import it.battlehorse.stamps.annotations.ModelDependent;
+
+import javax.swing.JPanel;
+
+import org.apache.log4j.Logger;
+import org.jnode.apps.jpartition.controller.MainController;
+import org.jnode.apps.jpartition.model.DeviceModel;
+
+public class DeviceView extends JPanel
+{
+ private static final Logger log = Logger.getLogger(DeviceView.class);
+
+ final private MainController controller;
+
+ //final private Object device;
+
+ public DeviceView(MainController controller)
+ {
+ this.controller = controller;
+ }
+
+/*
+ private static final Logger log = Logger.getLogger(DevicePartitionsUI.class);
+
+ final private DevicePartitionsList devicePartitions;
+
+ final private DefaultComboBoxModel cboDevicesModel = new DefaultComboBoxModel();
+ final private JComboBox cboDevices = new JComboBox(cboDevicesModel);
+ final private JPanel partitionsPanel = new JPanel(new FlowLayout());
+ final private PartitionController controller;
+
+ public DevicePartitionsUI(DevicePartitionsList devicePartitions, PartitionController controller)
+ {
+ super(new BorderLayout());
+
+ setBorder(BorderFactory.createTitledBorder(""));
+
+ this.devicePartitions = devicePartitions;
+ this.controller = controller;
+
+ JPanel devPanel = new JPanel(new BorderLayout());
+ devPanel.add(new JLabel("device : "), BorderLayout.WEST);
+ devPanel.add(cboDevices, BorderLayout.CENTER);
+ add(devPanel, BorderLayout.NORTH);
+
+ add(partitionsPanel, BorderLayout.CENTER);
+
+ for(DeviceModel devParts : devicePartitions)
+ {
+ cboDevicesModel.addElement(devParts);
+ }
+
+ if(cboDevicesModel.getSize() > 0)
+ {
+ cboDevices.setSelectedIndex(0);
+ }
+
+ cboDevices.addItemListener(new ItemListener()
+ {
+ public void itemStateChanged(ItemEvent event) {
+ if(event.getStateChange() == ItemEvent.SELECTED)
+ {
+ log.debug("itemStateChanged");
+ DeviceModel devParts = (DeviceModel) event.getItem();
+ partitionsPanel.removeAll();
+
+ if(devParts.getPartitions().isEmpty())
+ {
+ DiskAreaUI disk = new DiskAreaUI(DevicePartitionsUI.this.controller.getCommandProcessor(), devParts.getDevice());
+ disk.setLabel("disk not partitioned");
+ partitionsPanel.add(disk);
+ }
+ else
+ {
+ for(PartitionModel partition : devParts.getPartitions())
+ {
+ partitionsPanel.add(new PartitionUI(DevicePartitionsUI.this.controller.getCommandProcessor(), devParts.getDevice(), partition));
+ }
+ }
+ }
+ }
+ });
+ }
+
+ public void deviceAdded(DeviceModel devParts) {
+ log.debug("deviceAdded");
+ cboDevicesModel.addElement(devParts);
+ }
+
+ public void deviceRemoved(DeviceModel devParts) {
+ cboDevicesModel.removeElement(devParts);
+ }
+*/
+}
Added: trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/DiskAreaView.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/DiskAreaView.java (rev 0)
+++ trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/DiskAreaView.java 2007-04-15 21:17:16 UTC (rev 3164)
@@ -0,0 +1,85 @@
+package org.jnode.apps.jpartition.swingview;
+
+import java.awt.Color;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+
+import javax.swing.BorderFactory;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+
+import org.jnode.apps.jpartition.controller.MainController;
+
+public class DiskAreaView extends JPanel
+{
+ final protected MainController controller;
+
+ final protected JLabel lblInfos = new JLabel();
+
+ public DiskAreaView(MainController controller)
+ {
+ this.controller = controller;
+
+ setBorder(BorderFactory.createLineBorder(Color.BLUE, 5));
+ lblInfos.setBackground(Color.CYAN);
+ add(lblInfos);
+
+ addMouseListener(new MouseAdapter()
+ {
+ @Override
+ public void mousePressed(MouseEvent event) {
+ showMenu(event);
+ }
+
+ @Override
+ public void mouseReleased(MouseEvent event) {
+ showMenu(event);
+ }
+ });
+ }
+/*
+ final private CommandProcessor commandProcessor;
+ final private Device device;
+
+ public DiskAreaView(CommandProcessor commandProcessor, Device device)
+ {
+ this.commandProcessor = commandProcessor;
+ this.device = device;
+
+ setBorder(BorderFactory.createLineBorder(Color.BLUE, 5));
+ lblInfos.setBackground(Color.CYAN);
+ add(lblInfos);
+
+ addMouseListener(new MouseAdapter()
+ {
+ @Override
+ public void mousePressed(MouseEvent event) {
+ showMenu(event);
+ }
+
+ @Override
+ public void mouseReleased(MouseEvent event) {
+ showMenu(event);
+ }
+ });
+ }
+
+ public void setLabel(String label)
+ {
+ lblInfos.setText(label);
+ }
+*/
+
+ protected void showMenu(MouseEvent event)
+ {
+ //TODO add popup menu
+/*
+ if(event.isPopupTrigger())
+ {
+ JPopupMenu menu = new JPopupMenu("context menu");
+ menu.add(new JMenuItem(new InitMbrAction((IDEDevice) device, commandProcessor)));
+ menu.show(event.getComponent(), event.getX(), event.getY());
+ }
+*/
+ }
+}
Added: trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/ErrorReporter.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/ErrorReporter.java (rev 0)
+++ trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/ErrorReporter.java 2007-04-15 21:17:16 UTC (rev 3164)
@@ -0,0 +1,39 @@
+package org.jnode.apps.jpartition.swingview;
+
+import org.apache.log4j.Logger;
+
+import charva.awt.Component;
+import charvax.swing.JOptionPane;
+
+public class ErrorReporter {
+ public static void reportError(Logger log, Object source, Throwable t)
+ {
+ reportError(log, source, (Object) t);
+ }
+
+ public static void reportError(Logger log, Object source, String message)
+ {
+ reportError(log, source, (Object) message);
+ }
+
+ private static void reportError(Logger log, Object source, Object message)
+ {
+ Component parent = (source instanceof Component) ? (Component) source : null;
+ Throwable t = (message instanceof Throwable) ? (Throwable) message : null;
+
+ String msg = (t == null) ? String.valueOf(message) : t.getMessage();
+ JOptionPane.showMessageDialog(parent,
+ "an error happened : "+msg+"\nSee logs for details",
+ "error",
+ JOptionPane.ERROR_MESSAGE);
+
+ if(t != null)
+ {
+ log.error(msg, t);
+ }
+ else
+ {
+ log.error(msg);
+ }
+ }
+}
Added: trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/FileDeviceView.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/FileDeviceView.java (rev 0)
+++ trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/FileDeviceView.java 2007-04-15 21:17:16 UTC (rev 3164)
@@ -0,0 +1,81 @@
+package org.jnode.apps.jpartition.swingview;
+
+import it.battlehorse.stamps.annotations.ModelDependent;
+
+import java.awt.BorderLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.AbstractListModel;
+import javax.swing.DefaultListModel;
+import javax.swing.JButton;
+import javax.swing.JFrame;
+import javax.swing.JList;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+
+import org.apache.log4j.Logger;
+import org.jnode.apps.jpartition.controller.MainController;
+
+public class FileDeviceView extends JFrame
+{
+ private static final Logger log = Logger.getLogger(FileDeviceView.class);
+
+ private JList devicesList = new JList(new DefaultListModel());
+ private JPanel buttons = new JPanel();
+ private JButton addVMWareDiskButton = new JButton("add VMWare disk");
+ private JButton addFakeDiskButton = new JButton("add fake disk");
+ private JButton removeButton = new JButton("remove device");
+ final private MainController controller;
+
+ public FileDeviceView(MainController controller) throws Exception
+ {
+ this.controller = controller;
+
+ setTitle("File devices");
+ setLayout(new BorderLayout());
+ add(new JScrollPane(devicesList), BorderLayout.CENTER);
+ add(buttons, BorderLayout.SOUTH);
+
+ buttons.add(addVMWareDiskButton);
+ buttons.add(addFakeDiskButton);
+ buttons.add(removeButton);
+
+ addFakeDiskButton.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent event) {
+ FileDeviceView.this.controller.userAddFakeDisk();
+ }
+ });
+ addVMWareDiskButton.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent event) {
+ FileDeviceView.this.controller.userAddVMWareDisk();
+ }
+ });
+ removeButton.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent event) {
+ if(devicesList.getSelectedIndex() >= 0)
+ {
+ Object value = devicesList.getSelectedValue();
+ FileDeviceView.this.controller.userRemoveFileDevice(value);
+ }
+ }
+ });
+
+ setSize(600, 300);
+ setVisible(true);
+ setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ }
+
+ @ModelDependent(modelKey ="FileDeviceModel" , propertyKey = "deviceAdded")
+ public void addDevice(Object device) {
+ ((DefaultListModel) devicesList.getModel()).addElement(device);
+ }
+
+ @ModelDependent(modelKey ="FileDeviceModel" , propertyKey = "deviceRemoved")
+ public void removeDevice(Object device) {
+ ((DefaultListModel) devicesList.getModel()).removeElement(device);
+ }
+}
Added: trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/MainView.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/MainView.java (rev 0)
+++ trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/MainView.java 2007-04-15 21:17:16 UTC (rev 3164)
@@ -0,0 +1,76 @@
+package org.jnode.apps.jpartition.swingview;
+
+import it.battlehorse.stamps.annotations.ModelDependent;
+
+import java.awt.BorderLayout;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.JComboBox;
+import javax.swing.JComponent;
+import javax.swing.JFrame;
+
+import org.apache.log4j.Logger;
+import org.jnode.apps.jpartition.controller.MainController;
+
+public class MainView extends JFrame {
+ private static final Logger log = Logger.getLogger(DeviceView.class);
+
+ final private MainController controller;
+ final private DefaultComboBoxModel devices;
+ final private DeviceView deviceView;
+
+ public MainView(MainController controller,
+ JFrame fileDeviceView,
+ JComponent cmdProcessorView) throws Exception
+ {
+ this.controller = controller;
+
+ setTitle("JPartition");
+ setLayout(new BorderLayout());
+ setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+
+ add(cmdProcessorView, BorderLayout.SOUTH);
+
+ deviceView = new DeviceView(controller);
+ add(deviceView, BorderLayout.CENTER);
+
+ devices = new DefaultComboBoxModel();
+ JComboBox cboDevices = new JComboBox(devices);
+ cboDevices.addItemListener(new ItemListener()
+ {
+ public void itemStateChanged(ItemEvent event) {
+ boolean selected = (event.getStateChange() == ItemEvent.SELECTED);
+ if(selected)
+ {
+ MainView.this.controller.userSelectDevice(event.getItem());
+ }
+ }
+ });
+ add(cboDevices, BorderLayout.NORTH);
+
+ setSize(600, 300);
+ setVisible(true);
+ setLocation(fileDeviceView.getX(), fileDeviceView.getY() + fileDeviceView.getHeight());
+ }
+
+ @ModelDependent(modelKey ="DeviceModel" , propertyKey = "deviceStarted")
+ public void deviceStarted(Object device) {
+ log.debug("deviceStarted");
+ devices.addElement(device);
+ }
+
+ @ModelDependent(modelKey ="DeviceModel" , propertyKey = "deviceStop")
+ public void deviceStop(Object device) {
+ log.debug("deviceStop");
+ devices.removeElement(device);
+ }
+
+ @ModelDependent(modelKey ="DeviceModel" , propertyKey = "deviceSelected")
+ public void deviceSelected(Object device) {
+ log.debug("deviceSelected");
+ //TODO
+ //deviceView.init(device);
+ }
+}
Added: trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/PartitionView.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/PartitionView.java (rev 0)
+++ trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/PartitionView.java 2007-04-15 21:17:16 UTC (rev 3164)
@@ -0,0 +1,83 @@
+package org.jnode.apps.jpartition.swingview;
+
+import it.battlehorse.stamps.annotations.ModelDependent;
+
+import org.apache.log4j.Logger;
+import org.jnode.apps.jpartition.controller.MainController;
+import org.jnode.partitions.ibm.IBMPartitionTypes;
+
+public class PartitionView extends DiskAreaView
+{
+ private static final Logger log = Logger.getLogger(PartitionView.class);
+
+ private DeviceView deviceView;
+
+ public PartitionView(MainController controller, DeviceView deviceView)
+ {
+ super(controller);
+
+ this.deviceView = deviceView;
+ }
+
+ @ModelDependent(modelKey = "partition", propertyKey = "empty")
+ public void setEmpty(boolean empty) {
+ lblInfos.setText(empty ? "empty" : "");
+ }
+
+ @ModelDependent(modelKey = "partition", propertyKey = "bootable")
+ public void setBootable(boolean bootable) {
+ lblInfos.setText(bootable ? "B" : "");
+ }
+
+ @ModelDependent(modelKey = "partition", propertyKey = "type")
+ public void setType(IBMPartitionTypes type) {
+ lblInfos.setText(type.getName());
+ }
+
+ @ModelDependent(modelKey = "partition", propertyKey = "start")
+ public void setStart(long start) {
+
+ }
+
+ @ModelDependent(modelKey = "partition", propertyKey = "size")
+ public void setSize(long size) {
+ }
+
+/*
+ public PartitionModel getPartition() {
+ return partition;
+ }
+
+ public void setPartition(PartitionModel partition) {
+ if(this.partition != partition)
+ {
+ this.partition = partition;
+ refreshFromModel();
+ }
+ }
+
+ public void refreshFromModel()
+ {
+ StringBuilder sb = new StringBuilder();
+
+ String name = partition.getType().getName();
+ log.debug("refreshFromModel: name="+name);
+ if(name.length() > 10)
+ {
+ name = name.substring(0, 10);
+ }
+ String boot = partition.isBootable() ? "(B)" : "(-)";
+ log.debug("refreshFromModel: boot="+boot);
+
+ sb.append(boot).append(name);
+ if(!partition.isEmpty())
+ {
+ sb.append("-").append(partition.getStart());
+ sb.append("-").append(partition.getSize());
+ }
+ lblInfos.setText(sb.toString());
+
+ log.debug("refreshFromModel: description="+sb.toString());
+ }
+*/
+}
Added: trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/SwingViewFactory.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/SwingViewFactory.java (rev 0)
+++ trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/SwingViewFactory.java 2007-04-15 21:17:16 UTC (rev 3164)
@@ -0,0 +1,24 @@
+package org.jnode.apps.jpartition.swingview;
+
+import javax.swing.JComponent;
+import javax.swing.JFrame;
+
+import org.jnode.apps.jpartition.ViewFactory;
+import org.jnode.apps.jpartition.controller.MainController;
+
+public class SwingViewFactory implements ViewFactory {
+ public Object createDeviceView(MainController controller,
+ Object fileDeviceView, Object cmdProcessorView) throws Exception
+ {
+ return new MainView(controller, (JFrame)fileDeviceView, (JComponent)cmdProcessorView);
+ }
+
+ public Object createFileDeviceView(MainController controller) throws Exception
+ {
+ return new FileDeviceView(controller);
+ }
+
+ public Object createCommandProcessorView(MainController mainController) {
+ return new CommandProcessorView(mainController);
+ }
+}
Added: trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/actions/BaseDeviceAction.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/actions/BaseDeviceAction.java (rev 0)
+++ trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/actions/BaseDeviceAction.java 2007-04-15 21:17:16 UTC (rev 3164)
@@ -0,0 +1,54 @@
+package org.jnode.apps.jpartition.swingview.actions;
+
+import java.awt.event.ActionEvent;
+
+import javax.swing.AbstractAction;
+import javax.swing.Icon;
+
+import org.apache.log4j.Logger;
+import org.jnode.apps.jpartition.commands.BaseDeviceCommand;
+import org.jnode.apps.jpartition.commands.framework.Command;
+import org.jnode.apps.jpartition.commands.framework.CommandProcessor;
+import org.jnode.apps.jpartition.swingview.ErrorReporter;
+import org.jnode.driver.bus.ide.IDEDevice;
+
+abstract public class BaseDeviceAction extends AbstractAction
+{
+ private static final Logger log = Logger.getLogger(BaseDeviceAction.class);
+
+ final protected CommandProcessor processor;
+ final protected IDEDevice device;
+
+ public BaseDeviceAction(IDEDevice device, CommandProcessor processor) {
+ super();
+ this.processor = processor;
+ this.device = device;
+ }
+
+ public BaseDeviceAction(IDEDevice device, CommandProcessor processor, String name, Icon icon) {
+ super(name, icon);
+ this.processor = processor;
+ this.device = device;
+ }
+
+ public BaseDeviceAction(IDEDevice device, CommandProcessor processor, String name) {
+ super(name);
+ this.processor = processor;
+ this.device = device;
+ }
+
+ public void actionPerformed(ActionEvent event)
+ {
+ try
+ {
+ Command command = getCommand(device);
+ processor.addCommand(command);
+ }
+ catch(Throwable t)
+ {
+ ErrorReporter.reportError(log, this, t);
+ }
+ }
+
+ abstract protected BaseDeviceCommand getCommand(IDEDevice device);
+}
Added: trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/actions/InitMbrAction.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/actions/InitMbrAction.java (rev 0)
+++ trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/actions/InitMbrAction.java 2007-04-15 21:17:16 UTC (rev 3164)
@@ -0,0 +1,18 @@
+package org.jnode.apps.jpartition.swingview.actions;
+
+import org.jnode.apps.jpartition.commands.BaseDeviceCommand;
+import org.jnode.apps.jpartition.commands.InitMbrCommand;
+import org.jnode.apps.jpartition.commands.framework.CommandProcessor;
+import org.jnode.driver.bus.ide.IDEDevice;
+
+public class InitMbrAction extends BaseDeviceAction
+{
+ public InitMbrAction(IDEDevice device, CommandProcessor processor) {
+ super(device, processor, "init MBR");
+ }
+
+ @Override
+ protected BaseDeviceCommand getCommand(IDEDevice device) {
+ return new InitMbrCommand(device);
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|