mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-09 02:36:01 +02:00
Remove some unneeded exceptions.
Change-Id: I019898868080900213663d53d1b943048ae7383c Signed-off-by: Greg Watson <g.watson@computer.org>
This commit is contained in:
parent
f431ca6fc3
commit
12b86bff42
3 changed files with 22 additions and 31 deletions
|
@ -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 {
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -473,6 +473,7 @@ 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 {
|
||||||
|
@ -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);
|
||||||
|
|
Loading…
Add table
Reference in a new issue