Skip to content

Commit 1f5cf49

Browse files
ptzieglerazoitl
authored andcommitted
Bug 381171 - CreateRequest should extend LocationRequest
The class CreateRequest in the org.eclipse.gef.requests does not extend the LocationRequest class from the same package, instead of subclassing it simply reimplements the whole functionality. Closes https://bugs.eclipse.org/bugs/show_bug.cgi?id=381171
1 parent e5007f9 commit 1f5cf49

File tree

1 file changed

+2
-23
lines changed

1 file changed

+2
-23
lines changed

org.eclipse.gef/src/org/eclipse/gef/requests/CreateRequest.java

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2000, 2010 IBM Corporation and others.
2+
* Copyright (c) 2000, 2025 IBM Corporation and others.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License 2.0 which is available at
@@ -13,19 +13,17 @@
1313
package org.eclipse.gef.requests;
1414

1515
import org.eclipse.draw2d.geometry.Dimension;
16-
import org.eclipse.draw2d.geometry.Point;
1716

1817
import org.eclipse.gef.RequestConstants;
1918

2019
/**
2120
* A Request to create a new object.
2221
*/
23-
public class CreateRequest extends org.eclipse.gef.Request implements DropRequest {
22+
public class CreateRequest extends LocationRequest implements DropRequest {
2423

2524
private Object newObject;
2625

2726
private Dimension size;
28-
private Point location;
2927
private int flags = 0;
3028
private static final int SNAP_TO = 1;
3129

@@ -56,16 +54,6 @@ protected CreationFactory getFactory() {
5654
return creationFactory;
5755
}
5856

59-
/**
60-
* Returns the location of the object to be created.
61-
*
62-
* @return the location
63-
*/
64-
@Override
65-
public Point getLocation() {
66-
return location;
67-
}
68-
6957
/**
7058
* Gets the new object from the factory and returns that object.
7159
*
@@ -122,15 +110,6 @@ public void setFactory(CreationFactory factory) {
122110
creationFactory = factory;
123111
}
124112

125-
/**
126-
* Sets the location where the new object will be placed.
127-
*
128-
* @param location the location
129-
*/
130-
public void setLocation(Point location) {
131-
this.location = location;
132-
}
133-
134113
/**
135114
* Sets the size of the new object.
136115
*

0 commit comments

Comments
 (0)