Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/ConfigurePortHandler.java')
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/ConfigurePortHandler.java31
1 files changed, 17 insertions, 14 deletions
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/ConfigurePortHandler.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/ConfigurePortHandler.java
index 4852bc43a68..eb310147cdd 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/ConfigurePortHandler.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/ConfigurePortHandler.java
@@ -1,8 +1,8 @@
/*******************************************************************************
* All rights reserved. This program and the accompanying materials
- * are property of the CEA, their use is subject to specific agreement
+ * are property of the CEA, their use is subject to specific agreement
* with the CEA.
- *
+ *
* Contributors:
* CEA LIST - initial API and implementation
*******************************************************************************/
@@ -33,8 +33,8 @@ public class ConfigurePortHandler extends CmdHandler {
@Override
public boolean isEnabled() {
updateSelectedEObject();
- if((selectedEObject instanceof Class) ||
- (selectedEObject instanceof Port)) {
+ if ((selectedEObject instanceof Class) ||
+ (selectedEObject instanceof Port)) {
return true;
}
return false;
@@ -45,46 +45,49 @@ public class ConfigurePortHandler extends CmdHandler {
*
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
- if(!(selectedEObject instanceof NamedElement)) {
+ if (!(selectedEObject instanceof NamedElement)) {
return null;
}
- final NamedElement element = (NamedElement)selectedEObject;
+ final NamedElement element = (NamedElement) selectedEObject;
final Shell shell = new Shell();
// 1. select possible connectors according to port types
// (only show compatible connectors check-box?)
// 2. select implementation group according to connector type
- if(element instanceof Class) {
+ if (element instanceof Class) {
CommandSupport.exec(Messages.ConfigurePortHandler_ConfigurePorts, event, new RunnableWithResult() {
+ @Override
public CommandResult run() {
ConfigurePortDialog configurePortDialog =
- new ConfigurePortDialog(shell);
- if (configurePortDialog.init((Class)element)) {
+ new ConfigurePortDialog(shell);
+ if (configurePortDialog.init((Class) element)) {
configurePortDialog.setTitle(Messages.ConfigurePortHandler_ConfigurePorts);
configurePortDialog.setMessage(Messages.ConfigurePortHandler_ConfigurePortsOfComponent + " " + element.getName()); //$NON-NLS-1$
configurePortDialog.open();
- if(configurePortDialog.getReturnCode() == IDialogConstants.OK_ID) {
+ if (configurePortDialog.getReturnCode() == IDialogConstants.OK_ID) {
return CommandResult.newOKCommandResult();
}
}
return CommandResult.newCancelledCommandResult();
}
});
- } else if(element instanceof Port) {
+ } else if (element instanceof Port) {
CommandSupport.exec(Messages.ConfigurePortHandler_ConfigurePorts, event, new RunnableWithResult() {
+ @Override
public CommandResult run() {
ConfigurePortDialog configurePortDialog =
- new ConfigurePortDialog(shell);
- if (configurePortDialog.init((Port)element)) {
+ new ConfigurePortDialog(shell);
+ if (configurePortDialog.init((Port) element)) {
configurePortDialog.setTitle(Messages.ConfigurePortHandler_ConfigurePorts);
configurePortDialog.setMessage(Messages.ConfigurePortHandler_ConfigurePorts + " " + element.getName()); //$NON-NLS-1$
configurePortDialog.open();
- if(configurePortDialog.getReturnCode() == IDialogConstants.OK_ID) {
+ if (configurePortDialog.getReturnCode() == IDialogConstants.OK_ID) {
return CommandResult.newOKCommandResult();
}
}

Back to the top