1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 18:26:01 +02:00

Remove some unneeded exceptions.

Change-Id: I019898868080900213663d53d1b943048ae7383c
Signed-off-by: Greg Watson <g.watson@computer.org>
This commit is contained in:
Greg Watson 2015-02-17 09:52:00 -05:00
parent f431ca6fc3
commit 12b86bff42
3 changed files with 22 additions and 31 deletions

View file

@ -41,7 +41,7 @@ public class DeleteRemoteConnectionHandler extends AbstractHandler {
while (i.hasNext()) { while (i.hasNext()) {
Object obj = i.next(); Object obj = i.next();
if (obj instanceof IRemoteConnection) { if (obj instanceof IRemoteConnection) {
IRemoteConnection connection = (IRemoteConnection)obj; IRemoteConnection connection = (IRemoteConnection) obj;
IRemoteConnectionType connectionType = connection.getConnectionType(); IRemoteConnectionType connectionType = connection.getConnectionType();
if ((connectionType.getCapabilities() & IRemoteConnectionType.CAPABILITY_REMOVE_CONNECTIONS) != 0) { if ((connectionType.getCapabilities() & IRemoteConnectionType.CAPABILITY_REMOVE_CONNECTIONS) != 0) {
connections.add(connection); connections.add(connection);
@ -52,10 +52,11 @@ public class DeleteRemoteConnectionHandler extends AbstractHandler {
// Confirm the delete // Confirm the delete
String message = Messages.DeleteRemoteConnectionHandler_ConfirmDeleteMessage; String message = Messages.DeleteRemoteConnectionHandler_ConfirmDeleteMessage;
for (IRemoteConnection connection : connections) { for (IRemoteConnection connection : connections) {
message += " " + connection.getName(); //$NON-NLS-1 //$NON-NLS-1$ message += " " + connection.getName(); //$NON-NLS-1$
} }
message += "?"; //$NON-NLS-1 //$NON-NLS-1$ message += "?"; //$NON-NLS-1$
if (MessageDialog.openConfirm(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), Messages.DeleteRemoteConnectionHandler_DeleteConnectionTitle, message)) { if (MessageDialog.openConfirm(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
Messages.DeleteRemoteConnectionHandler_DeleteConnectionTitle, message)) {
for (IRemoteConnection connection : connections) { for (IRemoteConnection connection : connections) {
IRemoteConnectionType connectionType = connection.getConnectionType(); IRemoteConnectionType connectionType = connection.getConnectionType();
try { try {

View file

@ -15,7 +15,6 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.eclipse.core.filesystem.IFileStore; import org.eclipse.core.filesystem.IFileStore;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.operation.IRunnableContext; import org.eclipse.jface.operation.IRunnableContext;
@ -25,7 +24,6 @@ import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.wizard.ProgressMonitorPart; import org.eclipse.jface.wizard.ProgressMonitorPart;
import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnection;
import org.eclipse.remote.internal.ui.RemoteUIPlugin;
import org.eclipse.remote.internal.ui.messages.Messages; import org.eclipse.remote.internal.ui.messages.Messages;
import org.eclipse.remote.ui.widgets.RemoteResourceBrowserWidget; import org.eclipse.remote.ui.widgets.RemoteResourceBrowserWidget;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
@ -122,11 +120,7 @@ public class RemoteResourceBrowser extends Dialog implements IRunnableContext {
fResourceBrowserWidget.setInitialPath(fInitialPath); fResourceBrowserWidget.setInitialPath(fInitialPath);
} }
if (fConnection != null) { if (fConnection != null) {
try { fResourceBrowserWidget.setConnection(fConnection);
fResourceBrowserWidget.setConnection(fConnection);
} catch (CoreException e) {
RemoteUIPlugin.log(e.getStatus());
}
} }
updateDialog(); updateDialog();
return contents; return contents;
@ -187,11 +181,7 @@ public class RemoteResourceBrowser extends Dialog implements IRunnableContext {
}); });
fResourceBrowserWidget.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); fResourceBrowserWidget.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
if (fConnection != null) { if (fConnection != null) {
try { fResourceBrowserWidget.setConnection(fConnection);
fResourceBrowserWidget.setConnection(fConnection);
} catch (CoreException e) {
RemoteUIPlugin.log(e.getStatus());
}
} }
Composite monitorComposite = new Composite(main, SWT.NULL); Composite monitorComposite = new Composite(main, SWT.NULL);

View file

@ -473,7 +473,8 @@ public class RemoteResourceBrowserWidget extends Composite {
/** /**
* When a new connection is selected, make sure it is open before using it. * When a new connection is selected, make sure it is open before using it.
* @throws CoreException *
* @throws CoreException
*/ */
private void connectionSelected() throws CoreException { private void connectionSelected() throws CoreException {
/* /*
@ -525,19 +526,19 @@ public class RemoteResourceBrowserWidget extends Composite {
public void run() { public void run() {
DelayedInputDialog dialog = new DelayedInputDialog(getShell(), Messages.RemoteResourceBrowserWidget_1, DelayedInputDialog dialog = new DelayedInputDialog(getShell(), Messages.RemoteResourceBrowserWidget_1,
Messages.RemoteResourceBrowserWidget_2, basePath.getName(), new IInputValidator() { Messages.RemoteResourceBrowserWidget_2, basePath.getName(), new IInputValidator() {
@Override @Override
public String isValid(String newText) { public String isValid(String newText) {
if (!newText.equals("")) { //$NON-NLS-1$ if (!newText.equals("")) { //$NON-NLS-1$
IFileStore newPath = path.getChild(newText); IFileStore newPath = path.getChild(newText);
if (newPath.fetchInfo().exists()) { if (newPath.fetchInfo().exists()) {
return Messages.RemoteResourceBrowserWidget_3; return Messages.RemoteResourceBrowserWidget_3;
}
} else {
return Messages.RemoteResourceBrowserWidget_4;
}
return null;
} }
} else { });
return Messages.RemoteResourceBrowserWidget_4;
}
return null;
}
});
fValidateJob.setDialog(dialog); fValidateJob.setDialog(dialog);
if (dialog.open() == Dialog.OK) { if (dialog.open() == Dialog.OK) {
userPath[0] = dialog.getValue(); userPath[0] = dialog.getValue();
@ -654,9 +655,8 @@ public class RemoteResourceBrowserWidget extends Composite {
* Set the connection for the browser * Set the connection for the browser
* *
* @param connection * @param connection
* @throws CoreException
*/ */
public void setConnection(IRemoteConnection connection) throws CoreException { public void setConnection(IRemoteConnection connection) {
changeInput(connection); changeInput(connection);
if (fRemoteConnectionWidget != null) { if (fRemoteConnectionWidget != null) {
fRemoteConnectionWidget.setConnection(connection); fRemoteConnectionWidget.setConnection(connection);