Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

SWITCHYARD-1383 - Fix for classcastexception #225

Closed
wants to merge 1 commit into from

2 participants

@bfitzpat
Collaborator

No description provided.

@rcernich
Collaborator

These changes contain checkstyle errors. Please correct and resubmit.

@bfitzpat
Collaborator

Fixed the checkstyle issues and repushed.

@rcernich
Collaborator

processing

@rcernich
Collaborator

pushed

@rcernich rcernich closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 3, 2013
  1. @bfitzpat
This page is out of date. Refresh to see the latest.
View
19 ...rg.switchyard.tools.ui.editor/src/org/switchyard/tools/ui/editor/diagram/CreateWrapperCustomFeature.java
@@ -75,19 +75,24 @@ public String getName() {
private ICreateContext adaptCustomContextToCreateContext(ICustomContext customContext) {
CreateContext createContext = new CreateContext();
PictogramElement[] picElements = customContext.getPictogramElements();
- createContext.setTargetContainer((ContainerShape) picElements[0]);
+ if (picElements[0] instanceof ContainerShape) {
+ createContext.setTargetContainer((ContainerShape) picElements[0]);
- // making the absolute location point relative to the container
- int x = createContext.getTargetContainer().getGraphicsAlgorithm().getX() + 20;
- int y = createContext.getTargetContainer().getGraphicsAlgorithm().getY() + 20;
- createContext.setLocation(x, y);
+ // making the absolute location point relative to the container
+ int x = createContext.getTargetContainer().getGraphicsAlgorithm().getX() + 20;
+ int y = createContext.getTargetContainer().getGraphicsAlgorithm().getY() + 20;
+ createContext.setLocation(x, y);
+ }
return createContext;
}
@Override
public boolean canExecute(ICustomContext context) {
- ICreateContext createContext = adaptCustomContextToCreateContext(context);
- return _createFeature.canExecute(createContext);
+ if (this._createFeature != null) {
+ ICreateContext createContext = adaptCustomContextToCreateContext(context);
+ return _createFeature.canExecute(createContext);
+ }
+ return false;
}
}
Something went wrong with that request. Please try again.