/** * Construct a modal dialog to display the attributes for one or more objects. * * @param owner * the Frame over which the dialog will be displayed and centred. * @param title * a title for the dialog. * @param skinsFactory * factory for producing skinned GUI components. */ public ObjectsAttributesDialog(Frame owner, String title, SkinsFactory skinsFactory) { super(owner, title, true); this.skinsFactory = skinsFactory; this.initGui(); }
public boolean isCellEditable(int row, int column) { return isModifyMode(); } };
this.setResizable(true); this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); this.getRootPane().setDefaultButton(okButton); this.getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW) .put(KeyStroke.getKeyStroke("ESCAPE"), "ESCAPE"); this.getRootPane().getActionMap().put("ESCAPE", new AbstractAction() { private static final long serialVersionUID = -7768790936535999307L; this.getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW) .put(KeyStroke.getKeyStroke("PAGE_UP"), "PAGE_UP"); this.getRootPane().getActionMap().put("PAGE_UP", new AbstractAction() { private static final long serialVersionUID = -6324229423705756219L; this.getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW) .put(KeyStroke.getKeyStroke("PAGE_DOWN"), "PAGE_DOWN"); this.getRootPane().getActionMap().put("PAGE_DOWN", new AbstractAction() { private static final long serialVersionUID = -5808972377672449421L; this.getContentPane().add(container); this.pack(); this.setSize(new Dimension(450, 500)); this.setLocationRelativeTo(this.getOwner());
nextPreviousPanel.setVisible(false); displayObjectProperties(); int height = (isModifyMode() ? 450 : 400); if (objects.length > 1) { height += 30; this.pack(); this.setSize(new Dimension(450, height)); this.setLocationRelativeTo(this.getOwner()); this.setVisible(true);
objectsAttributesDialog = new ObjectsAttributesDialog( ownerFrame, "Object Attributes", skinsFactory); final String[] sourceObjectKeys = objectsAttributesDialog.getSourceObjectKeys(); final S3Object[] destinationObjects = objectsAttributesDialog.getDestinationObjects(); if (!objectsAttributesDialog.isModifyActionApproved()) {
displayObjectProperties(); } else if (e.getSource().equals(previousObjectButton)) { currentObjectIndex--; displayObjectProperties(); } else if ("OK".equals(e.getActionCommand())) { modifyActionApproved = isModifyMode(); this.setVisible(false); } else if ("Cancel".equals(e.getActionCommand())) { modifyActionApproved = false; this.setVisible(false); } else if ("addMetadataItem".equals(e.getActionCommand())) { int newRowNumber = metadataTable.getRowCount() + 1;
this.setResizable(true); this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); this.getRootPane().setDefaultButton(okButton); this.getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW) .put(KeyStroke.getKeyStroke("ESCAPE"), "ESCAPE"); this.getRootPane().getActionMap().put("ESCAPE", new AbstractAction() { private static final long serialVersionUID = -7768790936535999307L; this.getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW) .put(KeyStroke.getKeyStroke("PAGE_UP"), "PAGE_UP"); this.getRootPane().getActionMap().put("PAGE_UP", new AbstractAction() { private static final long serialVersionUID = -6324229423705756219L; this.getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW) .put(KeyStroke.getKeyStroke("PAGE_DOWN"), "PAGE_DOWN"); this.getRootPane().getActionMap().put("PAGE_DOWN", new AbstractAction() { private static final long serialVersionUID = -5808972377672449421L; this.getContentPane().add(container); this.pack(); this.setSize(new Dimension(450, 500)); this.setLocationRelativeTo(this.getOwner());
nextPreviousPanel.setVisible(false); displayObjectProperties(); int height = (isModifyMode() ? 450 : 400); if (objects.length > 1) { height += 30; this.pack(); this.setSize(new Dimension(450, height)); this.setLocationRelativeTo(this.getOwner()); this.setVisible(true);
objectsAttributesDialog = new ObjectsAttributesDialog( ownerFrame, "Object Attributes", skinsFactory); final String[] sourceObjectKeys = objectsAttributesDialog.getSourceObjectKeys(); final S3Object[] destinationObjects = objectsAttributesDialog.getDestinationObjects(); if (!objectsAttributesDialog.isModifyActionApproved()) {
displayObjectProperties(); } else if (e.getSource().equals(previousObjectButton)) { currentObjectIndex--; displayObjectProperties(); } else if ("OK".equals(e.getActionCommand())) { modifyActionApproved = isModifyMode(); this.setVisible(false); } else if ("Cancel".equals(e.getActionCommand())) { modifyActionApproved = false; this.setVisible(false); } else if ("addMetadataItem".equals(e.getActionCommand())) { int newRowNumber = metadataTable.getRowCount() + 1;
public boolean isCellEditable(int row, int column) { return isModifyMode(); } };
/** * Construct a modal dialog to display the attributes for one or more objects. * * @param owner * the Frame over which the dialog will be displayed and centred. * @param title * a title for the dialog. * @param skinsFactory * factory for producing skinned GUI components. */ public ObjectsAttributesDialog(Frame owner, String title, SkinsFactory skinsFactory) { super(owner, title, true); this.skinsFactory = skinsFactory; this.initGui(); }
/** * @return * objects containing updated metadata and Access Control List settings * provided by the user. When this dialog is approved, the S3 objects * should be updated in-place by copying over each object with an updated * version from this list. */ public S3Object[] getDestinationObjects() { if (!isModifyMode()) { return null; } return destinationObjects; }
/** * @return * objects containing updated metadata and Access Control List settings * provided by the user. When this dialog is approved, the S3 objects * should be updated in-place by copying over each object with an updated * version from this list. */ public S3Object[] getDestinationObjects() { if (!isModifyMode()) { return null; } return destinationObjects; }