new CockpitLite(ownerFrame, argumentProperties);
public void run() { S3Object[] objects = event.getObjectsWithUpdatedACL(); for (int i = 0; i < objects.length; i++) { String aclStatus = getAclDescription(objects[i].getAcl()); objectTableModel.updateObjectAclStatus(objects[i], aclStatus); objectSelectedAction(); } } });
/** * Follows hyperlinks clicked on by a user. This is achieved differently depending on whether * Cockpit is running as an applet or as a stand-alone application: * <ul> * <li>Application: Detects the default browser application for the user's system (using * <tt>BareBonesBrowserLaunch</tt>) and opens the link as a new window in that browser</li> * <li>Applet: Opens the link in the current browser using the applet's context</li> * </ul> * * @param url * the url to open * @param target * the target pane to open the url in, eg "_blank". This may be null. */ public void followHyperlink(URL url, String target) { if (!isStandAloneApplication) { if (target == null) { getAppletContext().showDocument(url); } else { getAppletContext().showDocument(url, target); } } else { BareBonesBrowserLaunch.openURL(url.toString()); } }
/** * Constructor to run this application in a stand-alone window. * * @param ownerFrame the frame the application will be displayed in * @throws S3ServiceException */ public CockpitLite(JFrame ownerFrame, Properties standAloneArgumentProperties) throws S3ServiceException { mCredentialProvider = new BasicCredentialsProvider(); this.ownerFrame = ownerFrame; this.standAloneArgumentProperties = standAloneArgumentProperties; isStandAloneApplication = true; init(); ownerFrame.getContentPane().add(this); ownerFrame.setBounds(this.getBounds()); ownerFrame.setVisible(true); }
listObjectProperties(); } else if ("RefreshObjects".equals(event.getActionCommand())) { new Thread() { generatePublicGetUrl(); } else if ("DeleteObjects".equals(event.getActionCommand())) { deleteSelectedObjects(); } else if ("DownloadObjects".equals(event.getActionCommand())) { try { downloadSelectedObjects(); } catch (Exception ex) { String message = "Unable to download objects from S3";
if (ServiceEvent.EVENT_STARTED == event.getEventCode()) { if (event.getThreadWatcher().getThreadCount() > 0) { startProgressDialog("Retrieved details for 0 of " + event.getThreadWatcher().getThreadCount() + " object(s)", "", 0, (int) event.getThreadWatcher().getThreadCount(), "Cancel Retrieval", updateProgressDialog(statusText, "", (int) progressStatus.getCompletedThreads()); stopProgressDialog(); compareRemoteAndLocalFiles(filesAlreadyInDownloadDirectoryMap, s3DownloadObjectsMap, false); isDownloadingObjects = false; } else if (isUploadingFiles) { compareRemoteAndLocalFiles(objectKeyToFilepathMap, s3ExistingObjectsMap, true); isUploadingFiles = false; } else if (isViewingObjectProperties) { stopProgressDialog(); stopProgressDialog();
this.getContentPane().add(primaryPanel); this.setBounds(new Rectangle(new Dimension(preferredWidth, preferredHeight))); initDropTarget(new JComponent[] {objectsPanel} ); objectsPanel.getDropTarget().setActive(true);
.populateObjectMap("", getSelectedObjects()); compareRemoteAndLocalFiles(filesAlreadyInDownloadDirectoryMap, s3DownloadObjectsMap, false);
while (st.hasMoreTokens()) { String paramName = st.nextToken(); String paramValue = this.getParameter(paramName); initGui();
/** * Stops/halts the progress display dialog and allows the user to interact with the application. */ private void stopProgressDialog() { this.getContentPane().setCursor(null); SwingUtilities.invokeLater(new Runnable() { public void run() { progressDialog.stopDialog(); } }); }
compareRemoteAndLocalFiles(objectKeyToFilepathMap, s3ExistingObjectsMap, true);
listObjectProperties(); } else if ("RefreshObjects".equals(event.getActionCommand())) { new Thread() { generatePublicGetUrl(); } else if ("DeleteObjects".equals(event.getActionCommand())) { deleteSelectedObjects(); } else if ("DownloadObjects".equals(event.getActionCommand())) { try { downloadSelectedObjects(); } catch (Exception ex) { String message = "Unable to download objects from S3";
if (ServiceEvent.EVENT_STARTED == event.getEventCode()) { if (event.getThreadWatcher().getThreadCount() > 0) { startProgressDialog("Retrieved details for 0 of " + event.getThreadWatcher().getThreadCount() + " object(s)", "", 0, (int) event.getThreadWatcher().getThreadCount(), "Cancel Retrieval", updateProgressDialog(statusText, "", (int) progressStatus.getCompletedThreads()); stopProgressDialog(); compareRemoteAndLocalFiles(filesAlreadyInDownloadDirectoryMap, s3DownloadObjectsMap, false); isDownloadingObjects = false; } else if (isUploadingFiles) { compareRemoteAndLocalFiles(objectKeyToFilepathMap, s3ExistingObjectsMap, true); isUploadingFiles = false; } else if (isViewingObjectProperties) { stopProgressDialog(); stopProgressDialog();
this.getContentPane().add(primaryPanel); this.setBounds(new Rectangle(new Dimension(preferredWidth, preferredHeight))); initDropTarget(new JComponent[] {objectsPanel} ); objectsPanel.getDropTarget().setActive(true);
/** * Constructor to run this application in a stand-alone window. * * @param ownerFrame the frame the application will be displayed in * @throws S3ServiceException */ public CockpitLite(JFrame ownerFrame, Properties standAloneArgumentProperties) throws S3ServiceException { mCredentialProvider = new BasicCredentialsProvider(); this.ownerFrame = ownerFrame; this.standAloneArgumentProperties = standAloneArgumentProperties; isStandAloneApplication = true; init(); ownerFrame.getContentPane().add(this); ownerFrame.setBounds(this.getBounds()); ownerFrame.setVisible(true); }
.populateObjectMap("", getSelectedObjects()); compareRemoteAndLocalFiles(filesAlreadyInDownloadDirectoryMap, s3DownloadObjectsMap, false);
while (st.hasMoreTokens()) { String paramName = st.nextToken(); String paramValue = this.getParameter(paramName); initGui();
/** * Stops/halts the progress display dialog and allows the user to interact with the application. */ private void stopProgressDialog() { this.getContentPane().setCursor(null); SwingUtilities.invokeLater(new Runnable() { public void run() { progressDialog.stopDialog(); } }); }
compareRemoteAndLocalFiles(objectKeyToFilepathMap, s3ExistingObjectsMap, true);
public void run() { S3Object[] objectsWithAcl = event.getObjectsWithACL(); for (int i = 0; i < objectsWithAcl.length; i++) { String aclStatus = getAclDescription(objectsWithAcl[i].getAcl()); objectTableModel.updateObjectAclStatus(objectsWithAcl[i], aclStatus); } } });