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()) {
|
||||
Object obj = i.next();
|
||||
if (obj instanceof IRemoteConnection) {
|
||||
IRemoteConnection connection = (IRemoteConnection)obj;
|
||||
IRemoteConnection connection = (IRemoteConnection) obj;
|
||||
IRemoteConnectionType connectionType = connection.getConnectionType();
|
||||
if ((connectionType.getCapabilities() & IRemoteConnectionType.CAPABILITY_REMOVE_CONNECTIONS) != 0) {
|
||||
connections.add(connection);
|
||||
|
@ -52,10 +52,11 @@ public class DeleteRemoteConnectionHandler extends AbstractHandler {
|
|||
// Confirm the delete
|
||||
String message = Messages.DeleteRemoteConnectionHandler_ConfirmDeleteMessage;
|
||||
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$
|
||||
if (MessageDialog.openConfirm(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), Messages.DeleteRemoteConnectionHandler_DeleteConnectionTitle, message)) {
|
||||
message += "?"; //$NON-NLS-1$
|
||||
if (MessageDialog.openConfirm(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
|
||||
Messages.DeleteRemoteConnectionHandler_DeleteConnectionTitle, message)) {
|
||||
for (IRemoteConnection connection : connections) {
|
||||
IRemoteConnectionType connectionType = connection.getConnectionType();
|
||||
try {
|
||||
|
|
|
@ -15,7 +15,6 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
import org.eclipse.core.filesystem.IFileStore;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.jface.dialogs.Dialog;
|
||||
import org.eclipse.jface.dialogs.IDialogConstants;
|
||||
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.wizard.ProgressMonitorPart;
|
||||
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.ui.widgets.RemoteResourceBrowserWidget;
|
||||
import org.eclipse.swt.SWT;
|
||||
|
@ -122,11 +120,7 @@ public class RemoteResourceBrowser extends Dialog implements IRunnableContext {
|
|||
fResourceBrowserWidget.setInitialPath(fInitialPath);
|
||||
}
|
||||
if (fConnection != null) {
|
||||
try {
|
||||
fResourceBrowserWidget.setConnection(fConnection);
|
||||
} catch (CoreException e) {
|
||||
RemoteUIPlugin.log(e.getStatus());
|
||||
}
|
||||
fResourceBrowserWidget.setConnection(fConnection);
|
||||
}
|
||||
updateDialog();
|
||||
return contents;
|
||||
|
@ -187,11 +181,7 @@ public class RemoteResourceBrowser extends Dialog implements IRunnableContext {
|
|||
});
|
||||
fResourceBrowserWidget.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
|
||||
if (fConnection != null) {
|
||||
try {
|
||||
fResourceBrowserWidget.setConnection(fConnection);
|
||||
} catch (CoreException e) {
|
||||
RemoteUIPlugin.log(e.getStatus());
|
||||
}
|
||||
fResourceBrowserWidget.setConnection(fConnection);
|
||||
}
|
||||
|
||||
Composite monitorComposite = new Composite(main, SWT.NULL);
|
||||
|
|
|
@ -473,7 +473,8 @@ public class RemoteResourceBrowserWidget extends Composite {
|
|||
|
||||
/**
|
||||
* When a new connection is selected, make sure it is open before using it.
|
||||
* @throws CoreException
|
||||
*
|
||||
* @throws CoreException
|
||||
*/
|
||||
private void connectionSelected() throws CoreException {
|
||||
/*
|
||||
|
@ -525,19 +526,19 @@ public class RemoteResourceBrowserWidget extends Composite {
|
|||
public void run() {
|
||||
DelayedInputDialog dialog = new DelayedInputDialog(getShell(), Messages.RemoteResourceBrowserWidget_1,
|
||||
Messages.RemoteResourceBrowserWidget_2, basePath.getName(), new IInputValidator() {
|
||||
@Override
|
||||
public String isValid(String newText) {
|
||||
if (!newText.equals("")) { //$NON-NLS-1$
|
||||
IFileStore newPath = path.getChild(newText);
|
||||
if (newPath.fetchInfo().exists()) {
|
||||
return Messages.RemoteResourceBrowserWidget_3;
|
||||
@Override
|
||||
public String isValid(String newText) {
|
||||
if (!newText.equals("")) { //$NON-NLS-1$
|
||||
IFileStore newPath = path.getChild(newText);
|
||||
if (newPath.fetchInfo().exists()) {
|
||||
return Messages.RemoteResourceBrowserWidget_3;
|
||||
}
|
||||
} else {
|
||||
return Messages.RemoteResourceBrowserWidget_4;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
return Messages.RemoteResourceBrowserWidget_4;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
});
|
||||
});
|
||||
fValidateJob.setDialog(dialog);
|
||||
if (dialog.open() == Dialog.OK) {
|
||||
userPath[0] = dialog.getValue();
|
||||
|
@ -654,9 +655,8 @@ public class RemoteResourceBrowserWidget extends Composite {
|
|||
* Set the connection for the browser
|
||||
*
|
||||
* @param connection
|
||||
* @throws CoreException
|
||||
*/
|
||||
public void setConnection(IRemoteConnection connection) throws CoreException {
|
||||
public void setConnection(IRemoteConnection connection) {
|
||||
changeInput(connection);
|
||||
if (fRemoteConnectionWidget != null) {
|
||||
fRemoteConnectionWidget.setConnection(connection);
|
||||
|
|
Loading…
Add table
Reference in a new issue