JBoss Tools SVN: r15407 - trunk/documentation/jbosstools-jdocbook-style/src/main/org/css/css.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2009-05-22 10:15:44 -0400 (Fri, 22 May 2009)
New Revision: 15407
Modified:
trunk/documentation/jbosstools-jdocbook-style/src/main/org/css/css/tools.css
Log:
https://jira.jboss.org/jira/browse/JBDS-730 - adding the JBoss Tools logo image;
Modified: trunk/documentation/jbosstools-jdocbook-style/src/main/org/css/css/tools.css
===================================================================
--- trunk/documentation/jbosstools-jdocbook-style/src/main/org/css/css/tools.css 2009-05-22 14:15:13 UTC (rev 15406)
+++ trunk/documentation/jbosstools-jdocbook-style/src/main/org/css/css/tools.css 2009-05-22 14:15:44 UTC (rev 15407)
@@ -19,7 +19,7 @@
width:100%;
height:100%;
position:absolute;
-top:-8px;
+top:0px;
left:0px;
z-index:-1;
}
@@ -74,9 +74,17 @@
}
div.abstract {
-font-size:10px;
+ font-size:10px;
}
+#title a.doc_href {
+ background: transparent url(../images/jbosstools_logo.png) no-repeat right top;
+ display:block;
+ height:89px;
+}
+.corpauthor img{
+ display:none !important;
+}
ul.docnav {
margin:0px;
15 years, 4 months
JBoss Tools SVN: r15406 - trunk/documentation/jbosstools-jdocbook-style/src/main/org/css/images.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2009-05-22 10:15:13 -0400 (Fri, 22 May 2009)
New Revision: 15406
Added:
trunk/documentation/jbosstools-jdocbook-style/src/main/org/css/images/jbosstools_logo.png
Log:
https://jira.jboss.org/jira/browse/JBDS-730 - adding the JBoss Tools logo image;
Added: trunk/documentation/jbosstools-jdocbook-style/src/main/org/css/images/jbosstools_logo.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/jbosstools-jdocbook-style/src/main/org/css/images/jbosstools_logo.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
15 years, 4 months
JBoss Tools SVN: r15405 - trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-05-22 09:07:41 -0400 (Fri, 22 May 2009)
New Revision: 15405
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamBigProjectTest.java
Log:
JBIDE-4351
Fluctuations of spent time often make the ratio greater than 2. I think that value 5 is still not large enough to suspect NxN behaviour, while such large fluctuations are rare.
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamBigProjectTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamBigProjectTest.java 2009-05-22 12:24:43 UTC (rev 15404)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamBigProjectTest.java 2009-05-22 13:07:41 UTC (rev 15405)
@@ -103,7 +103,7 @@
System.out.println("First 200 paths are loaded in " + t1 + "ms");
System.out.println("Last 200 paths are loaded in " + t2 + "ms");
double d = 1d * t2 / t1;
- if(d > 2d) {
+ if(d > 5d) {
fail("It takes " + d + " times longer to load path in the end "
+ "of seam model loading than in the beginning.\n"
+ "That implies that time depends as N*N on the number of components N.");
15 years, 4 months
JBoss Tools SVN: r15404 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/inplaceSelect.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2009-05-22 08:24:43 -0400 (Fri, 22 May 2009)
New Revision: 15404
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/inplaceSelect/JBIDE4309.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/inplaceSelect/JBIDE4309.xhtml.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-4309, junit was added.
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/inplaceSelect/JBIDE4309.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/inplaceSelect/JBIDE4309.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/inplaceSelect/JBIDE4309.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/inplaceSelect/JBIDE4309.xhtml.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/inplaceSelect/JBIDE4309.xhtml.xml 2009-05-22 12:24:43 UTC (rev 15404)
@@ -0,0 +1,7 @@
+<tests>
+ <test id="inplaceSelect">
+ <SPAN VPE-USER-TOGGLE-ID="false" CLASS="rich-inplace-select rich-inplace-select-view btn" STYLE="display: inline;">
+ Click here to edit
+ </SPAN>
+ </test>
+</tests>
\ No newline at end of file
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/inplaceSelect/JBIDE4309.xhtml.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:eol-style
+ native
15 years, 4 months
JBoss Tools SVN: r15403 - in trunk: vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2009-05-22 08:23:05 -0400 (Fri, 22 May 2009)
New Revision: 15403
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesAbstractInplaceTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceInputTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceSelectTemplate.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4309, style class was added, code adjustment, junits were updated.
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesAbstractInplaceTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesAbstractInplaceTemplate.java 2009-05-22 12:22:59 UTC (rev 15402)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesAbstractInplaceTemplate.java 2009-05-22 12:23:05 UTC (rev 15403)
@@ -67,52 +67,23 @@
/** The Constant VPE_USER_TOGGLE_ID_ATTR. */
public static final String VPE_USER_TOGGLE_ID_ATTR = "vpe-user-toggle-id"; //$NON-NLS-1$
- private static final String DEFAULT_LAYOUT = "inline"; //$NON-NLS-1$
-
- private static final String ALTERNATE_LAYOUT = "block"; //$NON-NLS-1$
-
/** The button images. */
protected final Map<String, String> buttonImages = new HashMap<String, String>();
- /** The controls horizontal position. */
- protected String controlsHorizontalPosition;
/** The controls horizontal positions. */
protected final Map<String, String> controlsHorizontalPositions = new HashMap<String, String>();
- /** The controls vertical position. */
- protected String controlsVerticalPosition;
-
- /** The default label. */
- protected String defaultLabel;
-
- /** The edit class. */
- protected String editClass;
- /** The view class. */
- protected String viewClass;
- /** The control class. */
- protected String controlClass;
-
/** The is show input. */
protected boolean isToggle = false;
+
- /** The show controls. */
- protected boolean showControls;
-
- /** The source value. */
- protected String sourceValue;
-
/** The Constant SPACER_GIF. */
protected final String SPACER_GIF = getCssExtension() + "/spacer.gif"; //$NON-NLS-1$
- /** The style class. */
- protected String styleClass;
-
protected String sourceCancelButtonIcon;
protected String sourceApplyButtonIcon;
- protected String sourceLayout;
-
/**
* The Constructor.
*/
@@ -130,14 +101,14 @@
* @param source the source
* @return the ns IDOM element
*/
- protected nsIDOMElement createRootSpanTemplateMethod(Element source, nsIDOMDocument visualDocument) {
+ protected nsIDOMElement createRootSpanTemplateMethod(Element source, nsIDOMDocument visualDocument, Attributes attrs) {
final nsIDOMElement rootSpan = visualDocument.createElement(HTML.TAG_SPAN);
// if(!(this.showControls && this.isToggle)){
rootSpan.setAttribute(VPE_USER_TOGGLE_ID_ATTR, String.valueOf(this.isToggle));
// }
// final String rootClass = MessageFormat.format(defaultStyleClasses.get("rootSpan"), getRootSpanClasses()); //$NON-NLS-1$
String rootStyleClass = "rich-inplace" + getCssStylesSuffix(); //$NON-NLS-1$
- for (String sc : getRootSpanClasses()) {
+ for (String sc : getRootSpanClasses(attrs)) {
if (ComponentUtil.isNotBlank(sc)) {
rootStyleClass += Constants.WHITE_SPACE + sc;
}
@@ -147,7 +118,7 @@
if (this.isToggle) {
style = "position: relative;"; //$NON-NLS-1$
}
- rootSpan.setAttribute(HTML.ATTR_STYLE, style + "; display:" + this.sourceLayout + Constants.SEMICOLON); //$NON-NLS-1$
+ rootSpan.setAttribute(HTML.ATTR_STYLE, style + "; display: " + attrs.getLayout() + Constants.SEMICOLON); //$NON-NLS-1$
return rootSpan;
}
@@ -177,19 +148,20 @@
*
* @return the root span classes
*/
- protected abstract String[] getRootSpanClasses();
+ protected abstract String[] getRootSpanClasses(Attributes attrs);
/**
* Gets the value.
*
* @return the value
*/
- protected String getValue() {
+ protected String getValue(Attributes attrs) {
String rst = Constants.EMPTY;
- if (ComponentUtil.isNotBlank(this.defaultLabel)) {
- rst = this.defaultLabel;
- } else if (ComponentUtil.isBlank(this.defaultLabel) && ComponentUtil.isNotBlank(this.sourceValue)) {
- rst = this.sourceValue;
+ if (ComponentUtil.isNotBlank(attrs.getDefaultLabel())) {
+ rst = attrs.getDefaultLabel();
+ } else if (ComponentUtil.isBlank(attrs.getDefaultLabel())
+ && ComponentUtil.isNotBlank(attrs.getValue())) {
+ rst = attrs.getValue();
} else {
rst = Constants.WHITE_SPACE;
}
@@ -231,65 +203,11 @@
}
/**
- * Checks if is in key set.
- *
- * @param map the map
- * @param value2 the value2
- * @return true, if is in key set
- */
- protected boolean isInKeySet(Map<String, String> map, String value2) {
- boolean rst = false;
- for (String key : map.keySet()) {
- if (key.equalsIgnoreCase(value2)) {
- rst = true;
- break;
- }
- }
- return rst;
- }
-
- /**
* Prepare data.
*
* @param source the source
*/
- protected void prepareData(VpePageContext pageContext,Element source) {
- this.styleClass = source.getAttribute(RichFaces.ATTR_STYLE_CLASS);
- this.editClass = source.getAttribute("editClass"); //$NON-NLS-1$
- this.viewClass = source.getAttribute("viewClass"); //$NON-NLS-1$
- this.controlClass = source.getAttribute("controlClass"); //$NON-NLS-1$
- this.sourceValue = source.getAttribute(RichFaces.ATTR_VALUE);
- this.sourceLayout = ComponentUtil.getAttribute(source, "layout"); //$NON-NLS-1$
- if(ComponentUtil.isBlank(this.sourceLayout) || (!this.sourceLayout.equalsIgnoreCase(DEFAULT_LAYOUT) &&
- !this.sourceLayout.equalsIgnoreCase(ALTERNATE_LAYOUT)) ) {
- this.sourceLayout = DEFAULT_LAYOUT;
- }
- this.defaultLabel = source.getAttribute("defaultLabel"); //$NON-NLS-1$
- if (ComponentUtil.isBlank(this.sourceValue)) {
- this.sourceValue = Constants.WHITE_SPACE;
- }
-// if ((source.getAttributeNode("value") != null) && ComponentUtil.isNotBlank(this.sourceValue)
-// && (this.sourceValue != DEFAULT_NULL_VALUE) && this.sourceValue.startsWith("#{")) {
-// this.sourceValue = ComponentUtil.getBundleValue(pageContext, source.getAttributeNode("value"));
-// }
-//
-// if ((source.getAttributeNode("defaultLabel") != null) && ComponentUtil.isNotBlank(this.defaultLabel)
-// && (this.defaultLabel != DEFAULT_NULL_VALUE) && this.defaultLabel.startsWith("#{")) {
-// this.defaultLabel = ComponentUtil.getBundleValue(pageContext, source.getAttributeNode("defaultLabel"));
-// }
-
- this.showControls = Boolean.parseBoolean(source.getAttribute("showControls")); //$NON-NLS-1$
- this.controlsVerticalPosition = source.getAttribute("controlsVerticalPosition"); //$NON-NLS-1$
- if (ComponentUtil.isBlank(this.controlsVerticalPosition) || !isInKeySet(controlsVerticalPositions, this.controlsVerticalPosition)) {
- this.controlsVerticalPosition = HTML.VALUE_ALIGN_CENTER;
- }
- this.controlsHorizontalPosition = source.getAttribute("controlsHorizontalPosition"); //$NON-NLS-1$
-
- if (ComponentUtil.isBlank(this.controlsHorizontalPosition)
- || !isInKeySet(controlsHorizontalPositions, this.controlsHorizontalPosition)) {
- this.controlsHorizontalPosition = HTML.VALUE_ALIGN_RIGHT;
- }
-
+ protected void prepareData(VpePageContext pageContext, Element source) {
prepareImages(source);
}
@@ -310,16 +228,6 @@
}
/**
- * Read attributes.
- *
- * @param source the source
- */
- protected void readAttributes(Element source) {
- this.styleClass = ComponentUtil.getAttribute(source, RichFaces.ATTR_STYLE_CLASS);
- this.sourceValue = ComponentUtil.getAttribute(source, RichFaces.ATTR_VALUE);
- }
-
- /**
* Sets the up image.
*
* @param img the img
@@ -342,15 +250,15 @@
* @param spanRoot the span root
* @param source the source
*/
- protected void setUpSpanRoot(nsIDOMElement spanRoot, Element source, nsIDOMDocument visualDocument) {
- if (this.styleClass.length() > 0) {
- spanRoot.setAttribute(HTML.ATTR_CLASS, this.styleClass);
+ protected void setUpSpanRoot(nsIDOMElement spanRoot, Element source, nsIDOMDocument visualDocument, Attributes attrs) {
+ if (attrs.getStyleClass().length() > 0) {
+ spanRoot.setAttribute(HTML.ATTR_CLASS, attrs.getStyleClass());
} else {
spanRoot.setAttribute(HTML.ATTR_CLASS, RICH_INPLACE_VIEW_DEFAULT_STYLE_CLASS);
}
String value = Constants.WHITE_SPACE;
- if (this.sourceValue.length() > 0) {
- value = this.sourceValue;
+ if (attrs.getValue().length() > 0) {
+ value = attrs.getValue();
}
final nsIDOMText text = visualDocument.createTextNode(value);
spanRoot.appendChild(text);
@@ -382,7 +290,7 @@
protected abstract String getCssStylesControlSuffix();
- protected abstract String getControlPositionsSubStyles();
+ protected abstract String getControlPositionsSubStyles(Attributes attrs);
protected abstract String getMainControlsDivCssClass();
@@ -397,11 +305,11 @@
*/
protected nsIDOMElement createControlsDiv(VpePageContext pageContext,
Node sourceNode, nsIDOMDocument visualDocument,
- VpeCreationData creationData) {
+ VpeCreationData creationData, Attributes attrs) {
final nsIDOMElement element = visualDocument.createElement(HTML.TAG_DIV);
element.setAttribute(HTML.ATTR_CLASS, getMainControlsDivCssClass());
- element.setAttribute(HTML.ATTR_STYLE, "position: absolute; " + getControlPositionsSubStyles()); //$NON-NLS-1$
+ element.setAttribute(HTML.ATTR_STYLE, "position: absolute; " + getControlPositionsSubStyles(attrs)); //$NON-NLS-1$
final nsIDOMElement divShadov = visualDocument.createElement(HTML.TAG_DIV);
divShadov.setAttribute(HTML.ATTR_CLASS, "rich-inplace" + getCssStylesSuffix() + "-shadow"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -448,8 +356,8 @@
applyButtonImg.setAttribute(HTML.ATTR_TYPE, HTML.VALUE_TYPE_IMAGE);
String applyButtonClass = "rich-inplace" + getCssStylesSuffix() + "-control"; //$NON-NLS-1$ //$NON-NLS-2$
- if (ComponentUtil.isNotBlank(controlClass)) {
- applyButtonClass += Constants.EMPTY + controlClass;
+ if (ComponentUtil.isNotBlank(attrs.getControlClass())) {
+ applyButtonClass += Constants.EMPTY + attrs.getControlClass();
}
applyButtonImg.setAttribute(HTML.ATTR_CLASS, applyButtonClass);
@@ -469,8 +377,8 @@
cancelButtonImg.setAttribute(HTML.ATTR_TYPE, HTML.VALUE_TYPE_IMAGE);
String cancelButtonClass = "rich-inplace" + getCssStylesSuffix() + "-control"; //$NON-NLS-1$ //$NON-NLS-2$
- if (ComponentUtil.isNotBlank(controlClass)) {
- cancelButtonClass += Constants.EMPTY + controlClass;
+ if (ComponentUtil.isNotBlank(attrs.getControlClass())) {
+ cancelButtonClass += Constants.EMPTY + attrs.getControlClass();
}
cancelButtonImg.setAttribute(HTML.ATTR_CLASS, cancelButtonClass);
@@ -512,4 +420,133 @@
return element;
}
+
+ class Attributes {
+
+ /*
+ * Attributes names
+ */
+ private final String EDIT_CLASS = "editClass"; //$NON-NLS-1$
+ private final String VIEW_CLASS = "viewClass"; //$NON-NLS-1$
+ private final String CONTROL_CLASS = "controlClass"; //$NON-NLS-1$
+ private final String SHOW_CONTROLS = "showControls"; //$NON-NLS-1$
+ private final String LAYOUT = "layout"; //$NON-NLS-1$
+ private final String CONTROLS_HORIZONTAL_POSOSITION = "controlsHorizontalPosition"; //$NON-NLS-1$
+ private final String CONTROLS_VERTICAL_POSITION = "controlsVerticalPosition"; //$NON-NLS-1$
+ private final String DEFAULT_LABEL = "defaultLabel"; //$NON-NLS-1$
+
+ private final String DEFAULT_VALUE = Constants.WHITE_SPACE;
+
+ /*
+ * Attributes
+ */
+ private String editClass;
+ private String viewClass;
+ private String controlClass;
+ private boolean showControls;
+ private String layout;
+ private String value;
+ private String controlsHorizontalPosition;
+ private String controlsVerticalPosition;
+ private String defaultLabel;
+ private String styleClass;
+
+ public Attributes(final Element sourceElement) {
+ if (null == sourceElement) {
+ return;
+ }
+ editClass = sourceElement.getAttribute(EDIT_CLASS);
+ viewClass = sourceElement.getAttribute(VIEW_CLASS);
+ controlClass = sourceElement.getAttribute(CONTROL_CLASS);
+ showControls = Boolean.parseBoolean(sourceElement.getAttribute(SHOW_CONTROLS));
+ layout = sourceElement.getAttribute(LAYOUT);
+ value = sourceElement.getAttribute(HTML.ATTR_VALUE);
+ controlsHorizontalPosition = sourceElement.getAttribute(CONTROLS_HORIZONTAL_POSOSITION);
+ controlsVerticalPosition = sourceElement.getAttribute(CONTROLS_VERTICAL_POSITION);
+ defaultLabel = sourceElement.getAttribute(DEFAULT_LABEL);
+ styleClass = sourceElement.getAttribute(RichFaces.ATTR_STYLE_CLASS);
+
+ /*
+ * Setting default value when needed.
+ */
+ if (ComponentUtil.isBlank(value)) {
+ value = DEFAULT_VALUE;
+ }
+ if (ComponentUtil.isBlank(layout)
+ || (!(layout.equalsIgnoreCase(HTML.VALUE_INLINE))
+ && !(layout.equalsIgnoreCase(HTML.VALUE_BLOCK)))) {
+ layout = HTML.VALUE_INLINE;
+ }
+ if (ComponentUtil.isBlank(controlsVerticalPosition)
+ || !isInKeySet(controlsVerticalPositions,
+ controlsVerticalPosition)) {
+ this.controlsVerticalPosition = HTML.VALUE_ALIGN_CENTER;
+ }
+ if (ComponentUtil.isBlank(controlsHorizontalPosition)
+ || !isInKeySet(controlsHorizontalPositions,
+ controlsHorizontalPosition)) {
+ this.controlsHorizontalPosition = HTML.VALUE_ALIGN_RIGHT;
+ }
+ }
+
+
+ /**
+ * Checks if the value is in the map's key set.
+ *
+ * @param map the map
+ * @param value the value
+ * @return true, if the value is in
+ */
+ protected boolean isInKeySet(Map<String, String> map, String value) {
+ boolean rst = false;
+ for (String key : map.keySet()) {
+ if (key.equalsIgnoreCase(value)) {
+ rst = true;
+ break;
+ }
+ }
+ return rst;
+ }
+
+ public String getEditClass() {
+ return editClass;
+ }
+
+ public String getViewClass() {
+ return viewClass;
+ }
+
+ public String getLayout() {
+ return layout;
+ }
+
+ public String getControlClass() {
+ return controlClass;
+ }
+
+ public boolean isShowControls() {
+ return showControls;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public String getControlsHorizontalPosition() {
+ return controlsHorizontalPosition;
+ }
+
+ public String getControlsVerticalPosition() {
+ return controlsVerticalPosition;
+ }
+
+ public String getDefaultLabel() {
+ return defaultLabel;
+ }
+
+ public String getStyleClass() {
+ return styleClass;
+ }
+ }
+
}
\ No newline at end of file
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceInputTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceInputTemplate.java 2009-05-22 12:22:59 UTC (rev 15402)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceInputTemplate.java 2009-05-22 12:23:05 UTC (rev 15403)
@@ -58,13 +58,13 @@
VpeCreationData data = null;
// <span id="j_id5" class="rich-inplace rich-inplace-view" style="">
ComponentUtil.setCSSLink(pageContext, getCssStyle(), getCssExtension());
- // cast to Element
- Element sourceElement = (Element) sourceNode;
+ // cast to Element
+ Element sourceElement = (Element) sourceNode;
+ final Attributes attrs = new Attributes(sourceElement);
+ // prepare images
+ prepareImages(sourceElement);
- // prepare style classes for inplace input controls
- prepareData(pageContext, sourceElement);
-
- final nsIDOMElement rootSpan = createRootSpanTemplateMethod(sourceElement, visualDocument);
+ final nsIDOMElement rootSpan = createRootSpanTemplateMethod(sourceElement, visualDocument, attrs);
final nsIDOMElement innerInput1 = visualDocument.createElement(HTML.TAG_INPUT);
data = new VpeCreationData(rootSpan, true);
@@ -76,8 +76,8 @@
innerInput1.setAttribute(HTML.ATTR_TYPE, HTML.VALUE_TYPE_TEXT);
innerInput1.setAttribute("autocomplete", "off"); //$NON-NLS-1$ //$NON-NLS-2$
- if (showControls) {
- rootSpan.appendChild(createControlsDiv(pageContext, sourceNode, visualDocument, data));
+ if (attrs.isShowControls()) {
+ rootSpan.appendChild(createControlsDiv(pageContext, sourceNode, visualDocument, data, attrs));
}
} else {
innerInput1.setAttribute(HTML.ATTR_STYLE,
@@ -91,9 +91,9 @@
data.addChildrenInfo(new VpeChildrenInfo(rootSpan));
}
if (!isToggle) {
- rootSpan.appendChild(visualDocument.createTextNode(getValue()));
+ rootSpan.appendChild(visualDocument.createTextNode(getValue(attrs)));
} else {
- innerInput1.setAttribute(HTML.ATTR_VALUE, this.sourceValue);
+ innerInput1.setAttribute(HTML.ATTR_VALUE, getValue(attrs));
}
// final DOMTreeDumper dumper = new DOMTreeDumper();
// dumper.dumpToStream(System.err, rootSpan);
@@ -135,25 +135,25 @@
*
* @return the root span classes
*/
- protected String[] getRootSpanClasses() {
+ protected String[] getRootSpanClasses(Attributes attrs) {
String[] rst = new String[3];
String clazz = Constants.EMPTY;
if (isToggle) {
rst[0] = "rich-inplace-edit"; //$NON-NLS-1$
- if (ComponentUtil.isNotBlank(this.editClass)) {
- clazz = this.editClass;
+ if (ComponentUtil.isNotBlank(attrs.getEditClass())) {
+ clazz = attrs.getEditClass();
rst[1] = clazz;
}
} else {
rst[0] = "rich-inplace-view"; //$NON-NLS-1$
- if (ComponentUtil.isNotBlank(this.viewClass)) {
- clazz = this.viewClass;
+ if (ComponentUtil.isNotBlank(attrs.getViewClass())) {
+ clazz = attrs.getViewClass();
rst[1] = clazz;
}
}
- if (ComponentUtil.isNotBlank(this.styleClass)) {
- rst[2] = this.styleClass;
+ if (ComponentUtil.isNotBlank(attrs.getStyleClass())) {
+ rst[2] = attrs.getStyleClass();
}
return rst;
}
@@ -172,7 +172,7 @@
}
this.controlsHorizontalPositions.put("right", this.inputWidth); //$NON-NLS-1$
this.controlsHorizontalPositions.put(HTML.VALUE_ALIGN_CENTER, "18px"); //$NON-NLS-1$
- super.prepareData(pageContext, source);
+ super.prepareImages(source);
}
/**
@@ -184,9 +184,9 @@
}
@Override
- protected String getControlPositionsSubStyles() {
- return "top: " + controlsVerticalPositions.get(this.controlsVerticalPosition) //$NON-NLS-1$
- + ";left:" + " " + controlsHorizontalPositions.get(this.controlsHorizontalPosition) + Constants.SEMICOLON; //$NON-NLS-1$//$NON-NLS-2$
+ protected String getControlPositionsSubStyles(Attributes attrs) {
+ return "top: " + controlsVerticalPositions.get(attrs.getControlsVerticalPosition()) //$NON-NLS-1$
+ + ";left: " + controlsHorizontalPositions.get(attrs.getControlsHorizontalPosition()) + Constants.SEMICOLON; //$NON-NLS-1$
}
@Override
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceSelectTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceSelectTemplate.java 2009-05-22 12:22:59 UTC (rev 15402)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceSelectTemplate.java 2009-05-22 12:23:05 UTC (rev 15403)
@@ -60,11 +60,12 @@
ComponentUtil.setCSSLink(pageContext, getCssStyle(), getCssExtension());
// cast to Element
final Element sourceElement = (Element) sourceNode;
+ final Attributes attrs = new Attributes(sourceElement);
+
+ // prepare images
+ prepareImages(sourceElement);
- // prepare style classes for inplace input controls
- prepareData(pageContext, sourceElement);
-
- final nsIDOMElement rootSpan = createRootSpanTemplateMethod(sourceElement, visualDocument);
+ final nsIDOMElement rootSpan = createRootSpanTemplateMethod(sourceElement, visualDocument, attrs);
data = new VpeCreationData(rootSpan, true);
if (isToggle) {
@@ -77,10 +78,10 @@
innerInput1.setAttribute("autocomplete", "off"); //$NON-NLS-1$ //$NON-NLS-2$
innerInput1.setAttribute(HTML.ATTR_CLASS, "rich-inplace-select-field"); //$NON-NLS-1$
innerInput1.setAttribute(HTML.ATTR_VALUE,
- ((this.defaultLabel == null) ? Constants.EMPTY : this.defaultLabel));
+ ((attrs.getDefaultLabel() == null) ? Constants.EMPTY : attrs.getDefaultLabel()));
// TODO
innerInput1.setAttribute(HTML.ATTR_STYLE, "top: 1px ; width:100px"); //$NON-NLS-1$
- innerInput1.setAttribute(HTML.ATTR_VALUE, getValue());
+ innerInput1.setAttribute(HTML.ATTR_VALUE, getValue(attrs));
innerInput2.setAttribute(HTML.ATTR_CLASS, "rich-inplace-select-arrow"); //$NON-NLS-1$
// TODO
innerInput2.setAttribute(HTML.ATTR_STYLE, "top: 2px; left: 89px;"); //$NON-NLS-1$
@@ -91,11 +92,11 @@
final nsIDOMElement selectList = createSelectedList(sourceElement, visualDocument);
rootSpan.appendChild(selectList);
}
- if (showControls) {
- rootSpan.appendChild(createControlsDiv(pageContext, sourceNode, visualDocument, data));
+ if (attrs.isShowControls()) {
+ rootSpan.appendChild(createControlsDiv(pageContext, sourceNode, visualDocument, data, attrs));
}
} else {
- rootSpan.appendChild(visualDocument.createTextNode(getValue()));
+ rootSpan.appendChild(visualDocument.createTextNode(getValue(attrs)));
}
// DOMTreeDumper d = new DOMTreeDumper();
// d.dumpToStream(System.err, rootSpan);
@@ -246,21 +247,24 @@
* @see org.jboss.tools.jsf.vpe.richfaces.template.RichFacesAbstractInplaceTemplate#getRootSpanClasses()
*/
@Override
- protected String[] getRootSpanClasses() {
- String[] result = new String[2];
+ protected String[] getRootSpanClasses(Attributes attrs) {
+ String[] result = new String[3];
String clazz = Constants.EMPTY;
if (this.isToggle) {
result[0] = "rich-inplace-select-edit"; //$NON-NLS-1$
- if (ComponentUtil.isNotBlank(this.editClass)) {
- clazz = this.editClass;
+ if (ComponentUtil.isNotBlank(attrs.getEditClass())) {
+ clazz = attrs.getEditClass();
}
} else {
result[0] = "rich-inplace-select-view"; //$NON-NLS-1$
- if (ComponentUtil.isNotBlank(this.viewClass)) {
- clazz = this.viewClass;
+ if (ComponentUtil.isNotBlank(attrs.getViewClass())) {
+ clazz = attrs.getViewClass();
}
}
result[1] = clazz;
+ if (ComponentUtil.isNotBlank(attrs.getStyleClass())) {
+ result[2] = attrs.getStyleClass();
+ }
return result;
}
@@ -292,7 +296,7 @@
this.sourceListWidth = String.valueOf("198px"); //$NON-NLS-1$
}
- super.prepareData(pageContext, source);
+ super.prepareImages(source);
}
@Override
@@ -312,9 +316,9 @@
* @see org.jboss.tools.jsf.vpe.richfaces.template.RichFacesAbstractInplaceTemplate#getControlPositionsSubStyles()
*/
@Override
- protected String getControlPositionsSubStyles() {
- return "top:0px ; left: " + controlsVerticalPositions.get(this.controlsVerticalPosition) //$NON-NLS-1$
- + ";left: " + controlsHorizontalPositions.get(this.controlsHorizontalPosition) + Constants.SEMICOLON; //$NON-NLS-1$
+ protected String getControlPositionsSubStyles(Attributes attrs) {
+ return "top:0px ; left: " + controlsVerticalPositions.get(attrs.getControlsVerticalPosition()) //$NON-NLS-1$
+ + ";left: " + controlsHorizontalPositions.get(attrs.getControlsHorizontalPosition()) + Constants.SEMICOLON; //$NON-NLS-1$
}
/**
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java 2009-05-22 12:22:59 UTC (rev 15402)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java 2009-05-22 12:23:05 UTC (rev 15403)
@@ -128,6 +128,8 @@
public static final String VALUE_TYPE_HIDDEN = "hidden"; //$NON-NLS-1$
public static final String VALUE_TYPE_BUTTON= "button"; //$NON-NLS-1$
public static final String VALUE_CLEAR_BOTH = "both"; //$NON-NLS-1$
+ public static final String VALUE_INLINE = "inline"; //$NON-NLS-1$
+ public static final String VALUE_BLOCK = "block"; //$NON-NLS-1$
public static final String STYLE_PARAMETER_DISPLAY = "display"; //$NON-NLS-1$
public static final String STYLE_VALUE_NONE = "none"; //$NON-NLS-1$
15 years, 4 months
JBoss Tools SVN: r15402 - in trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test: src/org/jboss/tools/jsf/vpe/richfaces/test and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2009-05-22 08:22:59 -0400 (Fri, 22 May 2009)
New Revision: 15402
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/inplaceSelect/inplaceSelect.xhtml.xml
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/inplaceSelect/inplaceSelect.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentContentTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4309, style class was added, code adjustment, junits were updated.
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/inplaceSelect/inplaceSelect.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/inplaceSelect/inplaceSelect.xhtml 2009-05-22 12:01:46 UTC (rev 15401)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/inplaceSelect/inplaceSelect.xhtml 2009-05-22 12:22:59 UTC (rev 15402)
@@ -9,7 +9,6 @@
<head>
</head>
<body>
-
- <rich:inplaceSelect/>
+ <rich:inplaceSelect id="id1" />
</body>
</html>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/inplaceSelect/inplaceSelect.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/inplaceSelect/inplaceSelect.xhtml.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/inplaceSelect/inplaceSelect.xhtml.xml 2009-05-22 12:22:59 UTC (rev 15402)
@@ -0,0 +1,7 @@
+<tests>
+ <test id="id1">
+ <SPAN VPE-USER-TOGGLE-ID="false"
+ CLASS="rich-inplace-select rich-inplace-select-view" STYLE="display: inline;">
+ </SPAN>
+ </test>
+</tests>
\ No newline at end of file
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/inplaceSelect/inplaceSelect.xhtml.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:eol-style
+ native
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentContentTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentContentTest.java 2009-05-22 12:01:46 UTC (rev 15401)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentContentTest.java 2009-05-22 12:22:59 UTC (rev 15402)
@@ -32,7 +32,12 @@
public void testJbide1605() throws Throwable {
performContentTest("components/panelMenuGroup/jbide1605.xhtml"); //$NON-NLS-1$
}
+
+ public void testJbide4309() throws Throwable {
+ performContentTest("components/inplaceSelect/JBIDE4309.xhtml"); //$NON-NLS-1$
+ }
+
public void testAjaxValidator() throws Throwable {
performInvisibleTagTest(
"components/ajaxValidator.xhtml", "ajaxValidator");//$NON-NLS-1$ //$NON-NLS-2$
15 years, 4 months
JBoss Tools SVN: r15401 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2009-05-22 08:01:46 -0400 (Fri, 22 May 2009)
New Revision: 15401
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4361 npe fix
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java 2009-05-22 10:53:12 UTC (rev 15400)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java 2009-05-22 12:01:46 UTC (rev 15401)
@@ -99,7 +99,14 @@
}
public IPath getStoreFolderPath() {
- return javaProject.getProject().getLocation().append(".settings").append(HIBERNATE_MAPPING_LAYOUT_FOLDER_NAME); //$NON-NLS-1$
+ IPath storePath = null;
+ if (javaProject != null && javaProject.getProject() != null) {
+ storePath = javaProject.getProject().getLocation();
+ }
+ else {
+ storePath = VisualEditorPlugin.getDefault().getStateLocation();
+ }
+ return storePath.append(".settings").append(HIBERNATE_MAPPING_LAYOUT_FOLDER_NAME); //$NON-NLS-1$
}
public IPath getStoreFilePath() {
@@ -700,7 +707,7 @@
public IFile createLayoutFile(InputStream source) {
IFile file = null;
- IPath path = javaProject.getProject().getLocation().append(".settings").append(HIBERNATE_MAPPING_LAYOUT_FOLDER_NAME); //$NON-NLS-1$
+ IPath path = getStoreFolderPath();
IFolder folder = ResourcesPlugin.getWorkspace().getRoot().getFolder(path);
if(!folder.exists()) {
try {
15 years, 4 months
JBoss Tools SVN: r15400 - in trunk: hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node and 26 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2009-05-22 06:53:12 -0400 (Fri, 22 May 2009)
New Revision: 15400
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/QueryEditorInput.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/QueryEditorStorage.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/BuildSessionFactoryAction.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/CloseAllQueryPageAction.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/EclipseImageMap.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/KnownConfigurationsView.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/QueryParametersPage.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/navigator/AdaptableWrapper.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/properties/CollectionPropertySource.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/properties/EntityPropertySource.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/BasicWorkbenchAdapter.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ConfigurationAdapterFactory.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ConfigurationWorkbenchAdapter.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/GenericPropertySource.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/AbstractGraphViewPart.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/layout/DirectedGraphLayoutVisitor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/layout/GraphAnimation.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/parts/PropertyEditPart.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLColors.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/AddPropertyDialog.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterAttributes.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/CollectEntityInfo.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/JavaPage.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/KnownConfigurations.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/QueryPage.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/SwingImageMap.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/BaseNode.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ConfigurationListNode.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/PersistentCollectionNode.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ProxyFactory.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/preferences/ConsoleConfigurationPreferences.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/CurrentContext.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/PluginLogAppender.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/PluginLogManager.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/DiagramContentOutlinePage.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/VisualEditor.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/autolayout/impl/Items.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/DiagramEditPart.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/ObjectEditorInput.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OpenDiagramActionDelegate.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmLabelProvider.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelNameVisitor.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ExporterTest.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/RefactoringTest.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/ProjectUtil.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/xpl/JavaProjectHelper.java
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/SwtUtils.java
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/tests/TestSuiteWithParams.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4357
More raw types used with generic parameter.
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -133,11 +133,11 @@
overrides.put( "hibernate.archive.autodetection", "none" ); //$NON-NLS-1$//$NON-NLS-2$
}
- Class clazz = ReflectHelper.classForName("org.hibernate.ejb.Ejb3Configuration", ConsoleConfiguration.class); //$NON-NLS-1$
+ Class<?> clazz = ReflectHelper.classForName("org.hibernate.ejb.Ejb3Configuration", ConsoleConfiguration.class); //$NON-NLS-1$
Object ejb3cfg = clazz.newInstance();
if(StringHelper.isNotEmpty(entityResolver)) {
- Class resolver = ReflectHelper.classForName(entityResolver, this.getClass());
+ Class<?> resolver = ReflectHelper.classForName(entityResolver, this.getClass());
Object object = resolver.newInstance();
Method method = clazz.getMethod("setEntityResolver", new Class[] { EntityResolver.class });//$NON-NLS-1$
method.invoke(ejb3cfg, new Object[] { object } );
@@ -163,10 +163,11 @@
}
}
+ @SuppressWarnings("unchecked")
private Configuration buildAnnotationConfiguration() throws ClassNotFoundException, InstantiationException, IllegalAccessException {
- Class clazz = ReflectHelper
+ Class<Configuration> clazz = ReflectHelper
.classForName( "org.hibernate.cfg.AnnotationConfiguration" ); //$NON-NLS-1$
- Configuration newInstance = (Configuration) clazz.newInstance();
+ Configuration newInstance = clazz.newInstance();
return newInstance;
}
@@ -241,7 +242,7 @@
public Configuration buildWith(final Configuration cfg, final boolean includeMappings) {
URL[] customClassPathURLs = getCustomClassPathURLs();
executionContext = new DefaultExecutionContext( getName(), new URLClassLoader( customClassPathURLs, getParentClassLoader() ) {
- protected Class findClass(String name) throws ClassNotFoundException {
+ protected Class<?> findClass(String name) throws ClassNotFoundException {
try {
return super.findClass( name );
} catch(ClassNotFoundException cnfe) {
@@ -249,7 +250,7 @@
}
}
- protected synchronized Class loadClass(String name, boolean resolve) throws ClassNotFoundException {
+ protected synchronized Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
try {
return super.loadClass( name, resolve );
} catch(ClassNotFoundException cnfe) {
@@ -257,7 +258,7 @@
}
}
- public Class loadClass(String name) throws ClassNotFoundException {
+ public Class<?> loadClass(String name) throws ClassNotFoundException {
try {
return super.loadClass( name );
} catch(ClassNotFoundException cnfe) {
@@ -346,6 +347,7 @@
return result;
}
+ @SuppressWarnings("unchecked")
private Configuration loadConfigurationXML(Configuration localCfg, boolean includeMappings, EntityResolver entityResolver) {
File configXMLFile = prefs.getConfigXMLFile();
if(!includeMappings) {
@@ -448,6 +450,7 @@
*
* @param driverClassName
*/
+ @SuppressWarnings("unchecked")
private void registerFakeDriver(String driverClassName) {
if(driverClassName!=null) {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/JavaPage.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/JavaPage.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/JavaPage.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -78,7 +78,7 @@
criteria.setMaxResults( model.getMaxResults().intValue() );
}
} else if (o instanceof List) {
- list = (List) o;
+ list = (List<Object>) o;
if(model.getMaxResults()!=null) {
list = list.subList( 0, Math.min( list.size(), model.getMaxResults().intValue() ) );
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/KnownConfigurations.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/KnownConfigurations.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/KnownConfigurations.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -55,7 +55,6 @@
import org.hibernate.console.node.ConfigurationListNode;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
-import org.w3c.dom.Node;
/**
* This class keeps track of the Hibernate Configurations that are known to
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/QueryPage.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/QueryPage.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/QueryPage.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -37,12 +37,12 @@
*/
public abstract long getQueryTime();
- public abstract List getList();
+ public abstract List<Object> getList();
/**
* @param i
*/
public abstract void setId(int i);
- public abstract List getPathNames();
+ public abstract List<String> getPathNames();
public abstract void release();
/**
* @return
@@ -55,7 +55,7 @@
/**
* @return
*/
- public abstract List getExceptions();
+ public abstract List<Throwable> getExceptions();
/**
* @return
*/
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/SwingImageMap.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/SwingImageMap.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/SwingImageMap.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -38,14 +38,14 @@
declareImages();
}
- Map imageRegistry = new HashMap();
+ Map<String, ImageIcon> imageRegistry = new HashMap<String, ImageIcon>();
protected void declareRegistryImage(String key, String path) {
imageRegistry.put(key, new ImageIcon(SwingImages.class.getResource(path) ) );
}
public Icon getIcon(String iconName) {
- return (Icon) imageRegistry.get(iconName);
+ return imageRegistry.get(iconName);
}
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/BaseNode.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/BaseNode.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/BaseNode.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -24,7 +24,6 @@
import java.util.ArrayList;
import java.util.Collections;
import java.util.Enumeration;
-import java.util.Iterator;
import java.util.List;
import javax.swing.tree.TreeNode;
@@ -42,7 +41,7 @@
protected BaseNode parent;
protected NodeFactory factory;
- protected List<TreeNode> children = new ArrayList<TreeNode>();
+ protected List<BaseNode> children = new ArrayList<BaseNode>();
protected String name = "!"; //$NON-NLS-1$
String iconName = ImageConstants.UNKNOWNPROPERTY;
@@ -93,7 +92,7 @@
return getChildCount()==0;
}
- public Enumeration children() {
+ public Enumeration<BaseNode> children() {
checkChildren();
return Collections.enumeration(children);
}
@@ -122,8 +121,7 @@
/** clear/reset this node. Mainly get rid of children. **/
public void clear() {
- for (Iterator iter = children.iterator(); iter.hasNext();) {
- BaseNode element = (BaseNode) iter.next();
+ for (BaseNode element : children) {
element.clear();
}
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ConfigurationListNode.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ConfigurationListNode.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ConfigurationListNode.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -69,16 +69,10 @@
protected void checkChildren() {
if(!childrenCreated) {
ConsoleConfiguration[] configurations = kc.getConfigurations();
- Arrays.sort(configurations, new Comparator() {
- public boolean equals(Object obj) {
- return this==obj;
+ Arrays.sort(configurations, new Comparator<ConsoleConfiguration>() {
+ public int compare(ConsoleConfiguration o1, ConsoleConfiguration o2) {
+ return o1.getName().compareTo(o2.getName());
}
-
- public int compare(Object o1, Object o2) {
- return ( (ConsoleConfiguration)o1).getName()
- .compareTo(
- ( (ConsoleConfiguration)o2).getName() );
- }
});
for (int i = 0; i < configurations.length; i++) {
children.add(new ConfigurationNode(this, configurations[i]) );
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/PersistentCollectionNode.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/PersistentCollectionNode.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/PersistentCollectionNode.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -125,7 +125,7 @@
initCollectionObject();
int idx = 0;
if(!type.isArrayType() ) {
- Iterator i = ( (Collection)collectionObject).iterator();
+ Iterator<?> i = ( (Collection<?>)collectionObject).iterator();
while (i.hasNext() ) {
Object element = i.next();
@@ -146,7 +146,7 @@
}
- private TreeNode createNode(int idx, Object element, Type type) { // TODO: use a common way to create these darn nodes!
+ private BaseNode createNode(int idx, Object element, Type type) { // TODO: use a common way to create these darn nodes!
return new ClassNode(factory, this,type.getReturnedClass().getName(), factory.getMetaData(type.getReturnedClass() ),element,objectGraph);
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ProxyFactory.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ProxyFactory.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ProxyFactory.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -53,7 +53,7 @@
private static final CallbackFilter baseNodeFilter = new CallbackFilter() {
public int accept(Method method) {
- Class declaringClass = method.getDeclaringClass();
+ Class<?> declaringClass = method.getDeclaringClass();
if(ExecutionContextHolder.class.isAssignableFrom(declaringClass ) ) {
if(GET_EXECUTION_CONTEXT.equals(method.getName() ) ) {
return 1;
@@ -64,13 +64,9 @@
return 1;
}
}
-
- public boolean equals(Object o) {
- return o==this;
- }
};
- public static Enhancer createEnhancer(Class clazz) {
+ public static Enhancer createEnhancer(Class<?> clazz) {
Enhancer e = new Enhancer();
e.setSuperclass(clazz);
e.setCallbacks(new Callback[] { ProxyFactory.EXECUTIONCONTEXTHOLDER_METHOD_INTERCEPTOR, NoOp.INSTANCE });
@@ -98,7 +94,7 @@
}
- public static Object createEnhancedObject(Class clazz, Object realObject, ExecutionContextHolder ech) {
+ public static Object createEnhancedObject(Class<?> clazz, Object realObject, ExecutionContextHolder ech) {
Enhancer e = new Enhancer();
e.setSuperclass(clazz);
e.setInterfaces(new Class[] { ExecutionContextHolder.class } );
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/preferences/ConsoleConfigurationPreferences.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/preferences/ConsoleConfigurationPreferences.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/preferences/ConsoleConfigurationPreferences.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -52,7 +52,7 @@
// TODO: we should move this to some classhandler
static public class ConfigurationMode implements Serializable {
- private static final Map INSTANCES = new HashMap();
+ private static final Map<String, ConfigurationMode> INSTANCES = new HashMap<String, ConfigurationMode>();
public static final ConfigurationMode CORE = new ConfigurationMode( "CORE" ); //$NON-NLS-1$
public static final ConfigurationMode ANNOTATIONS = new ConfigurationMode( "ANNOTATIONS" ); //$NON-NLS-1$
@@ -79,7 +79,7 @@
}
public static ConfigurationMode parse(String name) {
- ConfigurationMode rtn = ( ConfigurationMode ) INSTANCES.get( name );
+ ConfigurationMode rtn = INSTANCES.get( name );
if ( rtn == null ) {
// default is POJO
rtn = CORE;
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/CurrentContext.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/CurrentContext.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/CurrentContext.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -11,13 +11,13 @@
public class CurrentContext {
- static Hashtable map = new Hashtable();
+ static Hashtable<Thread, Stack<Object>> map = new Hashtable<Thread, Stack<Object>>();
private CurrentContext() {
}
public static int getDepth() {
- Stack stack = (Stack) map.get( Thread.currentThread() );
+ Stack<Object> stack = map.get( Thread.currentThread() );
if ( stack == null )
return 0;
else
@@ -26,7 +26,7 @@
public static Object pop() {
Thread key = Thread.currentThread();
- Stack stack = (Stack) map.get( key );
+ Stack<Object> stack = map.get( key );
if ( stack != null && !stack.isEmpty() )
return (stack.pop() );
else
@@ -35,7 +35,7 @@
public static Object peek() {
Thread key = Thread.currentThread();
- Stack stack = (Stack) map.get( key );
+ Stack<Object> stack = map.get( key );
if ( stack != null && !stack.isEmpty() )
return stack.peek();
else
@@ -44,10 +44,10 @@
public static void push(Object message) {
Thread key = Thread.currentThread();
- Stack stack = (Stack) map.get( key );
+ Stack<Object> stack = map.get( key );
if ( stack == null ) {
- stack = new Stack();
+ stack = new Stack<Object>();
map.put( key, stack );
stack.push( message );
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/PluginLogAppender.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/PluginLogAppender.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/PluginLogAppender.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -44,7 +44,6 @@
public class PluginLogAppender extends AppenderSkeleton {
private ILog pluginLog;
- private Map streams = new HashMap();
/**
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/PluginLogManager.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/PluginLogManager.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/PluginLogManager.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -39,6 +39,7 @@
import org.apache.log4j.spi.RepositorySelector;
import org.apache.log4j.spi.RootLogger;
import org.eclipse.core.runtime.ILog;
+import org.eclipse.core.runtime.ILogListener;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Plugin;
@@ -52,7 +53,7 @@
private ILog log;
private IPath stateLocation;
private Hierarchy hierarchy;
- private HashMap hookedPlugins = new HashMap();
+ private HashMap<String, ILogListener> hookedPlugins = new HashMap<String, ILogListener>();
private LoggingHelper helper;
private class PluginEventListener implements HierarchyEventListener {
@@ -230,9 +231,9 @@
*/
void internalShutdown() {
synchronized(this.hookedPlugins) {
- Iterator it = this.hookedPlugins.keySet().iterator();
+ Iterator<String> it = this.hookedPlugins.keySet().iterator();
while (it.hasNext()) {
- String id = (String) it.next();
+ String id = it.next();
PluginLogListener listener = (PluginLogListener) this.hookedPlugins.get(id);
listener.dispose();
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/QueryEditorInput.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/QueryEditorInput.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/QueryEditorInput.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -38,7 +38,8 @@
return false;
}
- public Object getAdapter( Class adapter ) {
+ @SuppressWarnings("unchecked")
+ public Object getAdapter( Class adapter ) {
return null;
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/QueryEditorStorage.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/QueryEditorStorage.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/QueryEditorStorage.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -32,7 +32,8 @@
setContents(source);
}
- public Object getAdapter( Class key ) {
+ @SuppressWarnings("unchecked")
+ public Object getAdapter( Class key ) {
return null;
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/BuildSessionFactoryAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/BuildSessionFactoryAction.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/BuildSessionFactoryAction.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -44,7 +44,7 @@
}
protected void doRun() {
- for (Iterator i = getSelectedNonResources().iterator(); i.hasNext();) {
+ for (Iterator<?> i = getSelectedNonResources().iterator(); i.hasNext();) {
try {
Object node = i.next();
if(node instanceof ConsoleConfiguration) {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/CloseAllQueryPageAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/CloseAllQueryPageAction.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/CloseAllQueryPageAction.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -33,7 +33,7 @@
@Override
public void run() {
- List pages = KnownConfigurations.getInstance().getQueryPageModel().getPagesAsList();
+ List<QueryPage> pages = KnownConfigurations.getInstance().getQueryPageModel().getPagesAsList();
for (int i = 0; i < pages.size(); i++ ) {
KnownConfigurations.getInstance().getQueryPageModel().remove( (QueryPage) pages.get(i) );
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/EclipseImageMap.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/EclipseImageMap.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/EclipseImageMap.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -54,7 +54,7 @@
}
/** A table of all the <code>ImageDescriptor</code>s. */
- Map imageDescriptors = new HashMap();
+ Map<String, ImageDescriptor> imageDescriptors = new HashMap<String, ImageDescriptor>();
/** The image registry containing <code>Image</code>s. */
ImageRegistry imageRegistry = new ImageRegistry();
@@ -85,7 +85,7 @@
public ImageDescriptor getImageDescriptor(String key) {
- return (ImageDescriptor) imageDescriptors.get(key);
+ return imageDescriptors.get(key);
}
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/KnownConfigurationsView.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/KnownConfigurationsView.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/KnownConfigurationsView.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -41,7 +41,6 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.actions.ActionContext;
@@ -59,7 +58,6 @@
import org.hibernate.eclipse.console.workbench.xpl.AnyAdaptableLabelProvider;
import org.hibernate.mapping.PersistentClass;
import org.hibernate.mapping.Property;
-import org.hibernate.util.StringHelper;
/**
@@ -165,8 +163,7 @@
if(consoleConfiguration.isSessionFactoryCreated() ) {
String hql = node.getHQL();
// open HQL Editor
- HibernateConsolePlugin.getDefault().openScratchHQLEditor(
- consoleConfiguration == null ? null : consoleConfiguration.getName(), hql);
+ HibernateConsolePlugin.getDefault().openScratchHQLEditor(consoleConfiguration.getName(), hql);
/** /
// execute query and show results in
// Hibernate Query result view - commented cause old version
@@ -188,9 +185,8 @@
Object last = path.getLastSegment();
ConsoleConfiguration consoleConfiguration = (ConsoleConfiguration)(path.getSegment(0));
if (last instanceof PersistentClass || last.getClass() == Property.class){
- IEditorPart res = null;
try {
- res = OpenMappingAction.run(path, consoleConfiguration);
+ OpenMappingAction.run(path, consoleConfiguration);
} catch (PartInitException e) {
HibernateConsolePlugin.getDefault().logErrorMessage("Can't find mapping file.", e); //$NON-NLS-1$
} catch (JavaModelException e) {
@@ -224,6 +220,7 @@
viewer.getTree().setFocus();
}
+ @SuppressWarnings("unchecked")
public Object getAdapter(Class adapter) {
if (adapter.equals(IPropertySheetPage.class) )
{
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/QueryParametersPage.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/QueryParametersPage.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/QueryParametersPage.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -209,7 +209,7 @@
cqp.setName( (String) value );
}
if ( TYPE_PROPERTY.equals( property ) ) {
- Iterator iterator = possibleTypes.iterator();
+ Iterator<Type> iterator = possibleTypes.iterator();
int i = 0;
while(iterator.hasNext()) {
NullableType type = (NullableType) iterator.next();
@@ -242,11 +242,11 @@
return cqp.getName();
}
if ( TYPE_PROPERTY.equals( property ) ) {
- Iterator iterator = possibleTypes.iterator();
+ Iterator<Type> iterator = possibleTypes.iterator();
NullableType type = cqp.getType();
int i = 0;
while(iterator.hasNext()) {
- if (type == ((Type) iterator.next())) {
+ if (type == iterator.next()) {
return Integer.valueOf(i);
}
i++;
@@ -285,10 +285,10 @@
String[] valueTypes = new String[possibleTypes.size()];
- Iterator iterator = possibleTypes.iterator();
+ Iterator<Type> iterator = possibleTypes.iterator();
int i=0;
while ( iterator.hasNext() ) {
- Type element = (Type) iterator.next();
+ Type element = iterator.next();
valueTypes[i++] = element.getName();
}
CellEditor[] editors = new CellEditor[columnProperties.length];
@@ -364,7 +364,7 @@
public void run() {
ConsoleQueryParameter[] queryParameters = model.getQueryParameters();
- Map qp = new HashMap();
+ Map<String, ConsoleQueryParameter> qp = new HashMap<String, ConsoleQueryParameter>();
for (int i = 0; i < queryParameters.length; i++) {
ConsoleQueryParameter parameter = queryParameters[i];
qp.put(parameter.getName(), parameter);
@@ -377,7 +377,7 @@
ConsoleQueryParameter cqp = null;
int[] positions = StringHelper.locateUnquoted( queryString, '?' );
for (int i = 0; i < positions.length; i++) {
- cqp = (ConsoleQueryParameter) qp.get(""+i); //$NON-NLS-1$
+ cqp = qp.get(""+i); //$NON-NLS-1$
if(cqp==null) {
cqp = model.createUniqueParameter(""+i); //$NON-NLS-1$
}
@@ -385,7 +385,7 @@
}
StringTokenizer st = new StringTokenizer(queryString, ParserHelper.HQL_SEPARATORS);
- Set result = new HashSet();
+ Set<String> result = new HashSet<String>();
while ( st.hasMoreTokens() ) {
String string = st.nextToken();
@@ -394,10 +394,10 @@
}
}
- Iterator iterator = result.iterator();
+ Iterator<String> iterator = result.iterator();
while ( iterator.hasNext() ) {
- String paramName = (String) iterator.next();
- cqp = (ConsoleQueryParameter) qp.get(paramName);
+ String paramName = iterator.next();
+ cqp = qp.get(paramName);
if(cqp==null) {
cqp = model.createUniqueParameter(paramName);
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/navigator/AdaptableWrapper.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/navigator/AdaptableWrapper.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/navigator/AdaptableWrapper.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -31,6 +31,7 @@
this.element = element;
}
+ @SuppressWarnings("unchecked")
public Object getAdapter(Class adapter) {
if(adapter.isInstance(element)) {
return element;
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/properties/CollectionPropertySource.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/properties/CollectionPropertySource.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/properties/CollectionPropertySource.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -35,7 +35,7 @@
public class CollectionPropertySource implements IPropertySource {
- private Collection collection;
+ private Collection<?> collection;
IPropertyDescriptor[] descriptors = null;
@@ -45,9 +45,9 @@
private final ExecutionContextHolder currentConfiguration;
- Map values = new WeakHashMap();
+ Map<Object, Object> values = new WeakHashMap<Object, Object>();
- public CollectionPropertySource(Collection propertyValue, Session currentSession, ExecutionContextHolder currentConfiguration, CollectionMetadata collectionMetadata) {
+ public CollectionPropertySource(Collection<?> propertyValue, Session currentSession, ExecutionContextHolder currentConfiguration, CollectionMetadata collectionMetadata) {
collection = propertyValue;
this.currentSession = currentSession;
this.currentConfiguration = currentConfiguration;
@@ -73,7 +73,7 @@
Object value = values.get(id);
if(value==null) {
Integer i = (Integer) id;
- Iterator iterator = collection.iterator();
+ Iterator<?> iterator = collection.iterator();
int base = 0;
while(iterator.hasNext()) {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/properties/EntityPropertySource.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/properties/EntityPropertySource.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/properties/EntityPropertySource.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -118,10 +118,10 @@
propertyValue = classMetadata.getPropertyValue(reflectedObject, (String)id, EntityMode.POJO);
}
- if (propertyValue instanceof Collection) {
+ if (propertyValue instanceof Collection<?>) {
CollectionMetadata collectionMetadata = currentSession.getSessionFactory().getCollectionMetadata(classMetadata.getEntityName() + "." + id); //$NON-NLS-1$
if(collectionMetadata!=null) {
- propertyValue = new CollectionPropertySource((Collection) propertyValue,currentSession,currentConfiguration, collectionMetadata);
+ propertyValue = new CollectionPropertySource((Collection<?>) propertyValue,currentSession,currentConfiguration, collectionMetadata);
}
}
return propertyValue;
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/BasicWorkbenchAdapter.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/BasicWorkbenchAdapter.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/BasicWorkbenchAdapter.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -69,7 +69,7 @@
@SuppressWarnings("unchecked")
- protected <T> T[] toArray(Iterator<T> iterator, Class<T> clazz, Comparator<? super T> comparator) {
+ protected <T> T[] toArray(Iterator<? extends T> iterator, Class<T> clazz, Comparator<? super T> comparator) {
List<T> obj = toList( iterator );
T[] array = obj.toArray((T[])Array.newInstance(clazz, obj.size()) );
@@ -79,7 +79,7 @@
return array;
}
- private <T> List<T> toList(Iterator<T> iterator) {
+ private <T> List<T> toList(Iterator<? extends T> iterator) {
List<T> obj = new ArrayList<T>();
while ( iterator.hasNext() ) {
obj.add(iterator.next());
@@ -87,7 +87,7 @@
return obj;
}
- protected Object[] toArray(Enumeration<Object> enumeration, Class<?> clazz) {
+ protected Object[] toArray(Enumeration<?> enumeration, Class<?> clazz) {
List<Object> obj = new ArrayList<Object>();
while ( enumeration.hasMoreElements() ) {
obj.add(enumeration.nextElement());
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ConfigurationAdapterFactory.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ConfigurationAdapterFactory.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ConfigurationAdapterFactory.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -22,7 +22,6 @@
package org.hibernate.eclipse.console.workbench;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.Map;
import org.eclipse.core.runtime.IAdapterFactory;
@@ -44,12 +43,12 @@
public class ConfigurationAdapterFactory implements IAdapterFactory {
- private Class[] classes;
+ private Class<?>[] classes;
private IDeferredWorkbenchAdapter[] adapters;
public ConfigurationAdapterFactory() {
- Map map = new HashMap();
+ Map<Class<?>, IDeferredWorkbenchAdapter> map = new HashMap<Class<?>, IDeferredWorkbenchAdapter>();
map.put(ConsoleConfiguration.class, new ConsoleConfigurationWorkbenchAdapter());
map.put(Configuration.class, new ConfigurationWorkbenchAdapter());
@@ -68,16 +67,15 @@
classes = new Class[map.size()];
adapters = new IDeferredWorkbenchAdapter[map.size()];
- Iterator iter = map.entrySet().iterator();
int cnt = 0;
- while ( iter.hasNext() ) {
- Map.Entry entry = (Map.Entry) iter.next();
- classes[cnt] = (Class) entry.getKey();
- adapters[cnt] = (IDeferredWorkbenchAdapter) entry.getValue();
- cnt++;
+ for (Map.Entry<Class<?>, IDeferredWorkbenchAdapter> entry : map.entrySet()) {
+ classes[cnt] = entry.getKey();
+ adapters[cnt] = entry.getValue();
+ cnt++;
}
}
+ @SuppressWarnings("unchecked")
public Object getAdapter(Object adaptableObject, Class adapterType) {
if((adapterType==IDeferredWorkbenchAdapter.class || adapterType==IWorkbenchAdapter.class)) {
return getAdapter( adaptableObject );
@@ -95,7 +93,7 @@
private Object getAdapter(Object adaptableObject) {
for (int i = 0; i < classes.length; i++) {
- Class clazz = classes[i];
+ Class<?> clazz = classes[i];
if (clazz.isInstance(adaptableObject)) {
return adapters[i];
}
@@ -103,13 +101,13 @@
return null;
}
- public Class[] getAdapterList() {
- return new Class[] { IDeferredWorkbenchAdapter.class, IWorkbenchAdapter.class, IPropertySource.class, IPropertySource2.class };
+ public Class<?>[] getAdapterList() {
+ return new Class<?>[] { IDeferredWorkbenchAdapter.class, IWorkbenchAdapter.class, IPropertySource.class, IPropertySource2.class };
}
public void registerAdapters(IAdapterManager adapterManager) {
for (int i = 0; i < classes.length; i++) {
- Class clazz = classes[i];
+ Class<?> clazz = classes[i];
adapterManager.registerAdapters(this, clazz);
}
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ConfigurationWorkbenchAdapter.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ConfigurationWorkbenchAdapter.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ConfigurationWorkbenchAdapter.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -25,7 +25,6 @@
import java.util.Iterator;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.osgi.util.NLS;
import org.hibernate.cfg.Configuration;
import org.hibernate.console.ImageConstants;
import org.hibernate.console.KnownConfigurations;
@@ -35,14 +34,13 @@
public class ConfigurationWorkbenchAdapter extends BasicWorkbenchAdapter {
+ @SuppressWarnings("unchecked")
public Object[] getChildren(Object o) {
Configuration cfg = (Configuration) o;
- Iterator classMappings = cfg.getClassMappings();
- return toArray(classMappings, PersistentClass.class, new Comparator() {
+ Iterator<? extends PersistentClass> classMappings = cfg.getClassMappings();
+ return toArray(classMappings, PersistentClass.class, new Comparator<PersistentClass>() {
- public int compare(Object arg0, Object arg1) {
- PersistentClass p0 = (PersistentClass) arg0;
- PersistentClass p1 = (PersistentClass) arg1;
+ public int compare(PersistentClass p0, PersistentClass p1) {
String label0 = HibernateWorkbenchHelper.getLabelForClassName(p0.getEntityName());
String label1 = HibernateWorkbenchHelper.getLabelForClassName(p1.getEntityName());
return label0.compareTo(label1);
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/GenericPropertySource.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/GenericPropertySource.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/GenericPropertySource.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -34,12 +34,12 @@
private final Object real;
private IPropertyDescriptor[] descriptors;
- private HashMap map;
+ private HashMap<Object, IPropertyDescriptor> map;
public GenericPropertySource(Object real) {
this.real = real;
this.descriptors = buildPropertyDescriptors();
- this.map = new HashMap();
+ this.map = new HashMap<Object, IPropertyDescriptor>();
for (int i = 0; i < descriptors.length; i++) {
IPropertyDescriptor desc = descriptors[i];
map.put(desc.getId(), desc);
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -37,7 +37,6 @@
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.ITextListener;
-import org.eclipse.jface.text.ITextSelection;
import org.eclipse.jface.text.TextEvent;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.swt.layout.GridData;
@@ -143,6 +142,7 @@
return evalCtx ;
}
+ @SuppressWarnings("unchecked")
private String[] getImports() {
ConsoleConfiguration consoleConfiguration = getConsoleConfiguration();
@@ -151,12 +151,12 @@
consoleConfiguration.build();
}
- Set imports = new HashSet();
+ Set<String> imports = new HashSet<String>();
Configuration configuration = consoleConfiguration.getConfiguration();
if(configuration!=null) {
- Iterator classMappings = configuration.getClassMappings();
+ Iterator<PersistentClass> classMappings = configuration.getClassMappings();
while ( classMappings.hasNext() ) {
- PersistentClass clazz = (PersistentClass) classMappings.next();
+ PersistentClass clazz = classMappings.next();
String className = clazz.getClassName();
if(className!=null) {
imports.add( className );
@@ -167,11 +167,10 @@
imports.add("org.hibernate.*"); //$NON-NLS-1$
imports.add("org.hibernate.criterion.*"); //$NON-NLS-1$
- return (String[]) imports.toArray( new String[imports.size()] );
+ return imports.toArray( new String[imports.size()] );
}
public void codeComplete(String prefix, CompletionProposalCollector collector, int position, IJavaProject project) throws JavaModelException {
- ITextSelection selection= (ITextSelection)getSelectionProvider().getSelection();
String code= getSourceViewer().getDocument().get();
code= prefix + code;
IEvaluationContext e= getEvaluationContext(project);
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/AbstractGraphViewPart.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/AbstractGraphViewPart.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/AbstractGraphViewPart.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -125,6 +125,7 @@
}
}
+ @SuppressWarnings("unchecked")
public Object getAdapter(Class adapter) {
if(adapter.equals(GraphicalViewer.class)) {
return viewer;
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/layout/DirectedGraphLayoutVisitor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/layout/DirectedGraphLayoutVisitor.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/layout/DirectedGraphLayoutVisitor.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -40,6 +40,7 @@
import org.eclipse.draw2d.graph.Edge;
import org.eclipse.draw2d.graph.Node;
import org.eclipse.draw2d.graph.NodeList;
+import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
import org.hibernate.eclipse.graph.parts.AssociationEditPart;
import org.hibernate.eclipse.graph.parts.ConfigurationEditPart;
import org.hibernate.eclipse.graph.parts.PersistentClassEditPart;
@@ -47,8 +48,8 @@
public class DirectedGraphLayoutVisitor
{
- Map partToNodesMap;
- Set addedAssociations;
+ Map<AbstractGraphicalEditPart, Object> partToNodesMap;
+ Set<AssociationEditPart> addedAssociations;
DirectedGraph graph;
private ConfigurationEditPart diagram;
@@ -59,8 +60,8 @@
public void layoutDiagram(ConfigurationEditPart diagram)
{
- partToNodesMap = new HashMap();
- addedAssociations = new HashSet();
+ partToNodesMap = new HashMap<AbstractGraphicalEditPart, Object>();
+ addedAssociations = new HashSet<AssociationEditPart>();
this.diagram = diagram;
graph = new DirectedGraph();
addNodes(diagram);
@@ -110,12 +111,11 @@
//******************* PersistentClassEditPart contribution methods **********/
+ @SuppressWarnings("unchecked")
protected void addEdges(PersistentClassEditPart classPart)
{
- List outgoing = classPart.getSourceConnections();
- for (int i = 0; i < outgoing.size(); i++)
- {
- AssociationEditPart relationshipPart = (AssociationEditPart) classPart.getSourceConnections().get(i);
+ List<AssociationEditPart> outgoing = classPart.getSourceConnections();
+ for (AssociationEditPart relationshipPart : outgoing) {
addEdges(relationshipPart);
}
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/layout/GraphAnimation.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/layout/GraphAnimation.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/layout/GraphAnimation.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -32,6 +32,7 @@
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.PointList;
import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.draw2d.geometry.Translatable;
/**
@@ -51,15 +52,15 @@
static boolean PLAYBACK;
static boolean RECORDING;
- static Map initialStates;
- static Map finalStates;
+ static Map<IFigure, Translatable> initialStates;
+ static Map<IFigure, Translatable> finalStates;
public static void end()
{
- Iterator iter = initialStates.keySet().iterator();
+ Iterator<IFigure> iter = initialStates.keySet().iterator();
while (iter.hasNext())
{
- IFigure f = ((IFigure) iter.next());
+ IFigure f = iter.next();
f.revalidate();
f.setVisible(true);
}
@@ -84,12 +85,12 @@
while (root.getParent() != null)
root = root.getParent();
- initialStates = new HashMap();
- finalStates = new HashMap();
+ initialStates = new HashMap<IFigure, Translatable>();
+ finalStates = new HashMap<IFigure, Translatable>();
//This part records all layout results.
root.validate();
- Iterator iter = initialStates.keySet().iterator();
+ Iterator<IFigure> iter = initialStates.keySet().iterator();
if (!iter.hasNext())
{
//Nothing layed out, so abort the animation
@@ -97,7 +98,7 @@
return false;
}
while (iter.hasNext())
- recordFinalState((IFigure) iter.next());
+ recordFinalState(iter.next());
start = System.currentTimeMillis();
finish = start + DURATION;
@@ -138,16 +139,17 @@
return true;
}
+ @SuppressWarnings("unchecked")
public static boolean playbackState(IFigure container)
{
if (!PLAYBACK)
return false;
- List children = container.getChildren();
+ List<IFigure> children = container.getChildren();
Rectangle rect1, rect2;
for (int i = 0; i < children.size(); i++)
{
- IFigure child = (IFigure) children.get(i);
+ IFigure child = children.get(i);
rect1 = (Rectangle) initialStates.get(child);
rect2 = (Rectangle) finalStates.get(child);
if (rect2 == null)
@@ -272,23 +274,24 @@
initialStates.put(connection, points);
}
+ @SuppressWarnings("unchecked")
public static void recordInitialState(IFigure container)
{
if (!RECORDING)
return;
- List children = container.getChildren();
+ List<IFigure> children = container.getChildren();
IFigure child;
for (int i = 0; i < children.size(); i++)
{
- child = (IFigure) children.get(i);
+ child = children.get(i);
initialStates.put(child, child.getBounds().getCopy());
}
}
public static void swap()
{
- Map temp = finalStates;
+ Map<IFigure, Translatable> temp = finalStates;
finalStates = initialStates;
initialStates = temp;
}
@@ -298,10 +301,10 @@
current = System.currentTimeMillis() + 30;
progress = (double) (current - start) / (finish - start);
progress = Math.min(progress, 0.999);
- Iterator iter = initialStates.keySet().iterator();
+ Iterator<IFigure> iter = initialStates.keySet().iterator();
while (iter.hasNext())
- ((IFigure) iter.next()).revalidate();
+ iter.next().revalidate();
viewport.validate();
// Point loc = viewport.getViewLocation();
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/parts/PropertyEditPart.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/parts/PropertyEditPart.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/parts/PropertyEditPart.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -36,6 +36,7 @@
import org.hibernate.eclipse.graph.anchor.LeftOrRightParentAnchor;
import org.hibernate.eclipse.graph.figures.EditableLabel;
import org.hibernate.eclipse.graph.model.PersistentClassViewAdapter;
+import org.hibernate.eclipse.graph.model.PropertyAssociationViewAdapter;
import org.hibernate.eclipse.graph.model.PropertyViewAdapter;
import org.hibernate.mapping.Property;
@@ -72,13 +73,13 @@
// TODO Auto-generated method stub
return super.getCommand( request );
}
- public List getModelSourceConnections() {
- List sc = ((PropertyViewAdapter) getModel()).getSourceConnections();
+ public List<PropertyAssociationViewAdapter> getModelSourceConnections() {
+ List<PropertyAssociationViewAdapter> sc = ((PropertyViewAdapter) getModel()).getSourceConnections();
return sc;
}
- public List getModelTargetConnections() {
- List tc = ((PropertyViewAdapter) getModel()).getTargetConnections();
+ public List<PropertyViewAdapter> getModelTargetConnections() {
+ List<PropertyViewAdapter> tc = ((PropertyViewAdapter) getModel()).getTargetConnections();
return tc;
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLColors.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLColors.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLColors.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -33,12 +33,12 @@
public class HQLColors {
- protected Map fColorTable = new HashMap(10);
+ protected Map<RGB, Color> fColorTable = new HashMap<RGB, Color>(10);
public void dispose() {
- Iterator e = fColorTable.values().iterator();
+ Iterator<Color> e = fColorTable.values().iterator();
while (e.hasNext())
- ((Color) e.next()).dispose();
+ e.next().dispose();
fColorTable.clear();
}
@@ -51,7 +51,7 @@
protected Color getColor(RGB rgb) {
if(rgb==null) rgb = new RGB(0,0,0);
- Color color = (Color) fColorTable.get(rgb);
+ Color color = fColorTable.get(rgb);
if (color == null) {
color = new Color(Display.getCurrent(), rgb);
fColorTable.put(rgb, color);
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditor.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditor.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -279,6 +279,7 @@
* @see org.eclipse.jface.text.source.projection.ProjectionSupport#getAdapter(org.eclipse.jface.text.source.ISourceViewer,
* java.lang.Class)
*/
+ @SuppressWarnings("unchecked")
public Object getAdapter( Class classForWhichAdapterNeeded ) {
Object adapter = null;
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/AddPropertyDialog.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/AddPropertyDialog.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/AddPropertyDialog.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -157,12 +157,12 @@
}
public Object[] getElements(Object inputElement) {
- Iterator set = localEf.getDefaultExporterProperties().entrySet().iterator();
+ Iterator<Map.Entry<String, ExporterProperty>> set = localEf.getDefaultExporterProperties().entrySet().iterator();
List<ExporterProperty> values = new ArrayList<ExporterProperty>(4);
while ( set.hasNext() ) {
- Map.Entry element = (Map.Entry) set.next();
+ Map.Entry<String, ExporterProperty> element = set.next();
//if(!localEf.hasLocalValueFor((String) element.getKey())) {
- ExporterProperty exporterProperty = localEf.getExporterProperty( (String) element.getKey() );
+ ExporterProperty exporterProperty = localEf.getExporterProperty( element.getKey() );
if(exporterProperty!=null) {
values.add(exporterProperty);
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -21,7 +21,6 @@
*/
package org.hibernate.eclipse.launch;
-import java.io.ByteArrayInputStream;
import java.io.File;
import java.lang.reflect.Constructor;
import java.util.HashSet;
@@ -39,6 +38,7 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -56,7 +56,6 @@
import org.eclipse.jdt.core.formatter.CodeFormatter;
import org.eclipse.jface.text.DocumentRewriteSessionType;
import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.util.Assert;
import org.eclipse.osgi.util.NLS;
import org.eclipse.text.edits.TextEdit;
import org.hibernate.HibernateException;
@@ -66,7 +65,6 @@
import org.hibernate.cfg.reveng.OverrideRepository;
import org.hibernate.cfg.reveng.ReverseEngineeringSettings;
import org.hibernate.cfg.reveng.ReverseEngineeringStrategy;
-import org.hibernate.cfg.reveng.TableFilter;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.HibernateConsoleRuntimeException;
import org.hibernate.console.KnownConfigurations;
@@ -96,7 +94,7 @@
throws CoreException, OperationCanceledException {
IResource bufferRes = ResourcesPlugin.getWorkspace().getRoot().findMember(textFileBuffer.getLocation());
- Map options = null;
+ Map<?, ?> options = null;
if(bufferRes!=null) {
IJavaProject project = JavaCore.create(bufferRes.getProject());
options = project.getOptions(true);
@@ -125,22 +123,20 @@
try {
ExporterAttributes attributes = new ExporterAttributes(configuration);
- List exporterFactories = attributes.getExporterFactories();
- for (Iterator iter = exporterFactories.iterator(); iter.hasNext();) {
- ExporterFactory exFactory = (ExporterFactory) iter.next();
+ List<ExporterFactory> exporterFactories = attributes.getExporterFactories();
+ for (Iterator<ExporterFactory> iter = exporterFactories.iterator(); iter.hasNext();) {
+ ExporterFactory exFactory = iter.next();
if(!exFactory.isEnabled(configuration)) {
iter.remove();
}
}
- Set outputDirectories = new HashSet();
- ExporterFactory[] exporters = (ExporterFactory[]) exporterFactories.toArray( new ExporterFactory[exporterFactories.size()] );
+ Set<String> outputDirectories = new HashSet<String>();
+ ExporterFactory[] exporters = exporterFactories.toArray( new ExporterFactory[exporterFactories.size()] );
ArtifactCollector collector = runExporters(attributes, exporters, outputDirectories, monitor);
- Iterator iterator = outputDirectories.iterator();
- while (iterator.hasNext()) {
- String path = (String) iterator.next();
- refreshOutputDir( path );
+ for (String path : outputDirectories) {
+ refreshOutputDir( path );
}
RefreshTab.refreshResources(configuration, monitor);
@@ -202,7 +198,7 @@
}
}
- private ArtifactCollector runExporters (final ExporterAttributes attributes, final ExporterFactory[] exporterFactories, final Set outputDirectories, final IProgressMonitor monitor)
+ private ArtifactCollector runExporters (final ExporterAttributes attributes, final ExporterFactory[] exporterFactories, final Set<String> outputDirectories, final IProgressMonitor monitor)
throws CoreException
{
@@ -337,11 +333,12 @@
}
// TODO: merge with revstrategy load in JDBCConfigurationTask
+ @SuppressWarnings("unchecked")
private ReverseEngineeringStrategy loadreverseEngineeringStrategy(final String className, ReverseEngineeringStrategy delegate) {
try {
Class clazz = ReflectHelper.classForName(className);
- Constructor constructor = clazz.getConstructor(new Class[] { ReverseEngineeringStrategy.class });
- return (ReverseEngineeringStrategy) constructor.newInstance(new Object[] { delegate });
+ Constructor<ReverseEngineeringStrategy> constructor = clazz.getConstructor(new Class[] { ReverseEngineeringStrategy.class });
+ return constructor.newInstance(new Object[] { delegate });
}
catch (NoSuchMethodException e) {
try {
@@ -382,6 +379,6 @@
protected void abort(String message, Throwable exception, int code)
throws CoreException {
- throw new CoreException(new Status(IStatus.ERROR, HibernateConsolePlugin.getDefault().ID, code, message, exception));
+ throw new CoreException(new Status(IStatus.ERROR, HibernateConsolePlugin.ID, code, message, exception));
}
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterAttributes.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterAttributes.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterAttributes.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -42,11 +42,9 @@
import java.util.ArrayList;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
-import java.util.StringTokenizer;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Path;
@@ -59,7 +57,6 @@
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.model.impl.ExporterDefinition;
import org.hibernate.eclipse.console.model.impl.ExporterFactory;
-import org.hibernate.mapping.Table;
// This class was created to centralize launch configuration attribute loading/saving
// (and also to clean up CodeGenerationLaunchDelegate considerably)
@@ -120,7 +117,8 @@
return HibernateLaunchConstants.ATTR_EXPORTERS + "." + exporterId; //$NON-NLS-1$
}
- private List<ExporterFactory> readExporterFactories(ILaunchConfiguration configuration) throws CoreException {
+ @SuppressWarnings("unchecked")
+private List<ExporterFactory> readExporterFactories(ILaunchConfiguration configuration) throws CoreException {
List<String> exporterNames = configuration.getAttribute(HibernateLaunchConstants.ATTR_EXPORTERS, (List<String>)null);
@@ -139,8 +137,8 @@
ExporterFactory exporterFactory = new ExporterFactory( expDef, exporterId );
exporterFactory.isEnabled( configuration );
factories.add( exporterFactory );
- Map props = configuration.getAttribute( getLaunchAttributePrefix(exporterFactory.getId())
- + ".properties", new HashMap() ); //$NON-NLS-1$
+ Map<String, String> props = configuration.getAttribute( getLaunchAttributePrefix(exporterFactory.getId())
+ + ".properties", new HashMap<String, String>() ); //$NON-NLS-1$
exporterFactory.setProperties( props );
}
}
@@ -156,8 +154,8 @@
ExporterFactory exporterFactory = new ExporterFactory( expDef, expDef.getId() );
exporterFactory.isEnabled( configuration );
factories.add( exporterFactory );
- Map props = configuration.getAttribute( getLaunchAttributePrefix(exporterFactory.getId())
- + ".properties", new HashMap() ); //$NON-NLS-1$
+ Map<String, String> props = configuration.getAttribute( getLaunchAttributePrefix(exporterFactory.getId())
+ + ".properties", new HashMap<String, String>() ); //$NON-NLS-1$
exporterFactory.setProperties( props );
}
@@ -167,22 +165,21 @@
public static void saveExporterFactories(
ILaunchConfigurationWorkingCopy configuration,
- List exporterFactories, Set enabledExporters, Set deletedExporterIds) {
+ List<ExporterFactory> exporterFactories, Set<ExporterFactory> enabledExporters, Set<String> deletedExporterIds) {
List<String> names = new ArrayList<String>();
- for (Iterator iter = exporterFactories.iterator(); iter.hasNext();) {
- ExporterFactory ef = (ExporterFactory) iter.next();
+ for (ExporterFactory ef : exporterFactories) {
configuration.setAttribute(getLaunchAttributePrefix(ef.getId()) + ".extension_id", ef.getExporterDefinition().getId()); //$NON-NLS-1$
boolean enabled = enabledExporters.contains( ef );
String propertiesId = getLaunchAttributePrefix(ef.getId()) + ".properties"; //$NON-NLS-1$
names.add(ef.getId());
ef.setEnabled( configuration, enabled, false );
- HashMap map = new HashMap(ef.getProperties());
+ HashMap<String, String> map = new HashMap<String, String>(ef.getProperties());
if(map.isEmpty()) {
- configuration.setAttribute( propertiesId, (Map)null );
+ configuration.setAttribute( propertiesId, (Map<String, String>)null );
} else {
configuration.setAttribute( propertiesId, map );
}
@@ -190,9 +187,7 @@
deletedExporterIds.removeAll(names);
- for (Iterator iterator = deletedExporterIds.iterator(); iterator.hasNext();) {
- String deleted = (String) iterator.next();
-
+ for (String deleted : deletedExporterIds) {
configuration.setAttribute( getLaunchAttributePrefix( deleted ), (String)null);
configuration.setAttribute(getLaunchAttributePrefix(deleted ) + ".extension_id", (String)null); //$NON-NLS-1$
configuration.setAttribute(getLaunchAttributePrefix(deleted), (String)null);
@@ -203,20 +198,18 @@
public static void oldSaveExporterFactories(
ILaunchConfigurationWorkingCopy configuration,
- List exporterFactories, List enabledExporters) {
+ List<ExporterFactory> exporterFactories, List<ExporterFactory> enabledExporters) {
-
- for (Iterator iter = exporterFactories.iterator(); iter.hasNext();) {
- ExporterFactory ef = (ExporterFactory) iter.next();
+ for (ExporterFactory ef : exporterFactories) {
boolean enabled = enabledExporters.contains( ef );
String propertiesId = ef.getId() + ".properties"; //$NON-NLS-1$
ef.setEnabled( configuration, enabled, true );
- HashMap map = new HashMap(ef.getProperties());
+ HashMap<String, String> map = new HashMap<String, String>(ef.getProperties());
if(map.isEmpty()) {
- configuration.setAttribute( propertiesId, (Map)null );
+ configuration.setAttribute( propertiesId, (Map<String, String>)null );
} else {
configuration.setAttribute( propertiesId, map );
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActor.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActor.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -201,6 +201,7 @@
/**
* update compilation unit of currently opened editor
*/
+ @SuppressWarnings("restriction")
public void updateOpen() {
IWorkbenchWindow activeWorkbenchWindow = getActiveWorkbenchWindow();
if (activeWorkbenchWindow == null) {
@@ -250,7 +251,7 @@
else if (selection instanceof TreeSelection) {
TreeSelection treeSelection = (TreeSelection)selection;
res = treeSelection.size();
- Iterator it = treeSelection.iterator();
+ Iterator<?> it = treeSelection.iterator();
while (it.hasNext()) {
Object obj = it.next();
if (excludeElement(obj)) {
@@ -264,6 +265,7 @@
/**
* @param sel - current selected workspace element for processing
*/
+ @SuppressWarnings("restriction")
synchronized private void updateSelectedItems(ISelection sel) {
//System.out.println("Blah! " + selection); //$NON-NLS-1$
if (sel instanceof TextSelection) {
@@ -271,7 +273,7 @@
IDocument fDocument = null;
SynchronizableDocument sDocument = null;
org.eclipse.jdt.core.dom.CompilationUnit resultCU = null;
- Class clazz = sel.getClass();
+ Class<?> clazz = sel.getClass();
Field fd = null;
try {
fd = clazz.getDeclaredField("fDocument"); //$NON-NLS-1$
@@ -324,7 +326,7 @@
else if (sel instanceof TreeSelection) {
clearSelectionCU();
TreeSelection treeSelection = (TreeSelection)sel;
- Iterator it = treeSelection.iterator();
+ Iterator<?> it = treeSelection.iterator();
while (it.hasNext()) {
Object obj = it.next();
processJavaElements(obj);
@@ -341,6 +343,7 @@
* @param obj
* @return exclusion result
*/
+ @SuppressWarnings("restriction")
protected boolean excludeElement(Object obj) {
boolean res = false;
if (obj instanceof JarPackageFragmentRoot) {
@@ -369,6 +372,7 @@
* Process object - java element to collect all it's children CompilationUnits
* @param obj
*/
+ @SuppressWarnings("restriction")
protected void processJavaElements(Object obj) {
if (obj instanceof ICompilationUnit) {
ICompilationUnit cu = (ICompilationUnit)obj;
@@ -376,7 +380,7 @@
}
else if (obj instanceof File) {
File file = (File)obj;
- if (file != null && file.getProject() != null) {
+ if (file.getProject() != null) {
IJavaProject javaProject = JavaCore.create(file.getProject());
ICompilationUnit[] cus = Utils.findCompilationUnits(javaProject,
file.getFullPath());
@@ -418,7 +422,6 @@
}
}
else if (obj instanceof PackageFragmentRoot) {
- PackageFragmentRoot packageFragmentRoot = (PackageFragmentRoot)obj;
JavaElement javaElement = (JavaElement)obj;
JavaElementInfo javaElementInfo = null;
try {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/CollectEntityInfo.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/CollectEntityInfo.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/CollectEntityInfo.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -53,6 +53,7 @@
*
* @author Vitali
*/
+@SuppressWarnings({ "unchecked", "restriction" })
public class CollectEntityInfo extends ASTVisitor {
/**
@@ -80,7 +81,7 @@
public boolean visit(NormalAnnotation node) {
// try to extract mapping prompts
String mappedBy = null;
- Iterator it = node.values().iterator();
+ Iterator<?> it = node.values().iterator();
while (it.hasNext()) {
MemberValuePair mvp = (MemberValuePair)it.next();
if ("mappedBy".equals(mvp.getName().toString())) { //$NON-NLS-1$
@@ -201,7 +202,7 @@
ASTNode astNode = node.getParent();
if (astNode instanceof FieldDeclaration) {
FieldDeclaration fd = (FieldDeclaration)astNode;
- Iterator itVarNames = fd.fragments().iterator();
+ Iterator<?> itVarNames = fd.fragments().iterator();
while (itVarNames.hasNext()) {
VariableDeclarationFragment var = (VariableDeclarationFragment)itVarNames.next();
String name = var.getName().getIdentifier();
@@ -236,7 +237,7 @@
ASTNode astNode = node.getParent();
if (astNode instanceof FieldDeclaration) {
FieldDeclaration fd = (FieldDeclaration)astNode;
- Iterator itVarNames = fd.fragments().iterator();
+ Iterator<?> itVarNames = fd.fragments().iterator();
while (itVarNames.hasNext()) {
VariableDeclarationFragment var = (VariableDeclarationFragment)itVarNames.next();
String name = var.getName().getIdentifier();
@@ -285,6 +286,7 @@
return true;
}
+
public boolean visit(TypeDeclaration node) {
boolean isAbstruct = entityInfo.isAbstractFlag() ||
Modifier.isAbstract(node.getModifiers()) || node.isInterface();
@@ -312,8 +314,8 @@
entityInfo.setFullyQualifiedParentName(entityFullyQualifiedName);
}
}
- List superInterfaces = node.superInterfaceTypes();
- Iterator it = superInterfaces.iterator();
+ List<?> superInterfaces = node.superInterfaceTypes();
+ Iterator<?> it = superInterfaces.iterator();
while (it.hasNext()) {
Object obj = it.next();
if (obj instanceof SimpleType) {
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/DiagramContentOutlinePage.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/DiagramContentOutlinePage.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/DiagramContentOutlinePage.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -11,24 +11,31 @@
package org.jboss.tools.hibernate.ui.veditor.editors;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.Set;
import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.draw2d.*;
-import org.eclipse.draw2d.parts.*;
-import org.eclipse.gef.*;
+import org.eclipse.draw2d.LightweightSystem;
+import org.eclipse.draw2d.MarginBorder;
+import org.eclipse.draw2d.Viewport;
+import org.eclipse.draw2d.parts.ScrollableThumbnail;
+import org.eclipse.draw2d.parts.Thumbnail;
+import org.eclipse.gef.EditPartViewer;
+import org.eclipse.gef.GraphicalViewer;
+import org.eclipse.gef.LayerConstants;
+import org.eclipse.gef.RootEditPart;
import org.eclipse.gef.editparts.ScalableFreeformRootEditPart;
import org.eclipse.gef.editparts.ZoomManager;
-import org.eclipse.gef.ui.parts.*;
+import org.eclipse.gef.ui.parts.ContentOutlinePage;
+import org.eclipse.gef.ui.parts.SelectionSynchronizer;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.part.IPageSite;
import org.eclipse.ui.part.PageBook;
import org.jboss.tools.hibernate.ui.veditor.editors.model.OrmDiagram;
@@ -186,6 +193,7 @@
/**
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/
+ @SuppressWarnings("unchecked")
public Object getAdapter(Class type) {
if (type == ZoomManager.class) {
return ((ScalableFreeformRootEditPart) getGraphicalViewer()
@@ -216,9 +224,6 @@
setContents(getOrmDiagram());
}
-
- private DisposeListener disposeListener;
-
/**
*
*/
@@ -271,7 +276,7 @@
getSelectionSynchronizer().removeViewer(getViewer());
}
- Set listeners = new HashSet();
+ Set<ISelectionChangedListener> listeners = new HashSet<ISelectionChangedListener>();
public void addSelectionChangedListener(ISelectionChangedListener listener) {
super.addSelectionChangedListener(listener);
@@ -283,9 +288,7 @@
}
void replaceSelectionChangedListeners(GraphicalViewer graphicalViewer) {
- Iterator it = listeners.iterator();
- while(it.hasNext()) {
- ISelectionChangedListener l = (ISelectionChangedListener)it.next();
+ for (ISelectionChangedListener l : listeners) {
getViewer().removeSelectionChangedListener(l);
graphicalViewer.addSelectionChangedListener(l);
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/VisualEditor.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/VisualEditor.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/VisualEditor.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -117,7 +117,7 @@
private TransferDropTargetListener createTransferDropTargetListener() {
return new TemplateTransferDropTargetListener(getGraphicalViewer()) {
protected CreationFactory getFactory(Object template) {
- return new SimpleFactory((Class) template);
+ return new SimpleFactory((Class<?>) template);
}
};
}
@@ -159,6 +159,7 @@
}
}
+ @SuppressWarnings("unchecked")
public Object getAdapter(Class type) {
if (type == IContentOutlinePage.class) {
DiagramContentOutlinePage outline = new DiagramContentOutlinePage(
@@ -173,10 +174,10 @@
return super.getAdapter(type);
}
- public Set getSelectedElements_old() {
- Set ret = new HashSet();
- List selectedEditParts = getGraphicalViewer().getSelectedEditParts();
- Iterator iterator = selectedEditParts.iterator();
+ public Set<Object> getSelectedElements_old() {
+ Set<Object> ret = new HashSet<Object>();
+ List<?> selectedEditParts = getGraphicalViewer().getSelectedEditParts();
+ Iterator<?> iterator = selectedEditParts.iterator();
while (iterator.hasNext()) {
Object elem = iterator.next();
if (elem instanceof OrmEditPart) {
@@ -191,10 +192,10 @@
return ret;
}
- public Set getSelectedElements() {
- Set ret = new HashSet();
- List selectedEditParts = getGraphicalViewer().getSelectedEditParts();
- Iterator iterator = selectedEditParts.iterator();
+ public Set<Object> getSelectedElements() {
+ Set<Object> ret = new HashSet<Object>();
+ List<?> selectedEditParts = getGraphicalViewer().getSelectedEditParts();
+ Iterator<?> iterator = selectedEditParts.iterator();
while (iterator.hasNext()) {
Object elem = iterator.next();
if (elem instanceof OrmEditPart) {
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/autolayout/impl/Items.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/autolayout/impl/Items.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/autolayout/impl/Items.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -22,7 +22,7 @@
protected LayuotConstants constants;
protected IDiagramInfo process;
protected Item[] items;
- protected Map paths = new HashMap();
+ protected Map<String, Item> paths = new HashMap<String, Item>();
protected Groups groups = new Groups();
protected boolean override = false;
@@ -97,7 +97,7 @@
for (int j = 0; j < ts.length; j++) {
String target = ts[j].getTargetID();
if(target == null || target.length() == 0) continue;
- Item item2 = (Item)paths.get(target);
+ Item item2 = paths.get(target);
if(item2 == null) {
continue;
} if(items[i].isComment()) {
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/DiagramEditPart.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/DiagramEditPart.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/DiagramEditPart.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -88,7 +88,7 @@
public void restore() {
boolean dirty = getCastedModel().isDirty();
- HashMap hashMap = getCastedModel().getCloneElements();
+ HashMap<String, OrmShape> hashMap = getCastedModel().getCloneElements();
String childrenLocations[] = getCastedModel().getChildrenLocations();
int tempPoint = 1;
OrmShape ormShape;
@@ -100,7 +100,7 @@
&& childrenLocations[i].indexOf(';') != -1) {
string = childrenLocations[i].substring(0, childrenLocations[i]
.indexOf('@'));
- ormShape = (OrmShape) hashMap.remove(string);
+ ormShape = hashMap.remove(string);
if (ormShape != null) {
string = childrenLocations[i]
.substring(childrenLocations[i].indexOf('@') + 1);
@@ -125,14 +125,13 @@
RootClass[] ormElements = getCastedModel().getOrmElements();
for (int i = 0; i < childrenLocations.length; i++) {
RootClass persistentClass = ormElements[i];
- ormShape = (OrmShape) hashMap.remove(persistentClass
- .getEntityName());
+ ormShape = hashMap.remove(persistentClass.getEntityName());
if (ormShape != null) {
ormShape.setLocation(new Point(20, 20));
tempPoint = 40 + getChildrenFigurePreferredHeight(ormShape);
}
Table table = persistentClass.getTable();
- ormShape = (OrmShape) hashMap.remove(HibernateUtils.getTableName(table));
+ ormShape = hashMap.remove(HibernateUtils.getTableName(table));
if (ormShape != null) {
ormShape.setLocation(new Point(pointX, 20));
point = 40 + getChildrenFigurePreferredHeight(ormShape);
@@ -143,7 +142,7 @@
}
Object objects[] = hashMap.keySet().toArray();
for (int i = 0; i < objects.length; i++) {
- ormShape = (OrmShape) hashMap.get(objects[i]);
+ ormShape = hashMap.get(objects[i]);
if (ormShape != null
&& (ormShape.getOrmElement() instanceof RootClass || ormShape
.getOrmElement() instanceof SpecialOrmShape)) {
@@ -155,7 +154,7 @@
.getOrmElement())).getProperty().getValue())
.getElement();
Table ownerTable = component.getOwner().getTable();
- ormShape = (OrmShape) hashMap.remove(HibernateUtils.getTableName(ownerTable));
+ ormShape = hashMap.remove(HibernateUtils.getTableName(ownerTable));
// }
// if (ormShape != null ) {
// ormShape.setLocation(new Point(pointX,point));
@@ -166,12 +165,10 @@
point = tempPoint;
}
}
- Iterator iterator = hashMap.values().iterator();
- while (iterator.hasNext()) {
- ormShape = (OrmShape) iterator.next();
- if (ormShape.getOrmElement() instanceof Table) {
- ormShape.setLocation(new Point(pointX, point));
- point = point + getChildrenFigurePreferredHeight(ormShape) + 20;
+ for (OrmShape shape : hashMap.values()) {
+ if (shape.getOrmElement() instanceof Table) {
+ shape.setLocation(new Point(pointX, point));
+ point = point + getChildrenFigurePreferredHeight(shape) + 20;
}
}
getCastedModel().setDirty(dirty);
@@ -202,7 +199,7 @@
return j + 120;
}
- protected List getModelChildren() {
+ protected List<Shape> getModelChildren() {
return getCastedModel().getChildren();
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/ObjectEditorInput.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/ObjectEditorInput.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/ObjectEditorInput.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -63,6 +63,7 @@
}
+ @SuppressWarnings("unchecked")
public Object getAdapter(Class adapter) {
return null;
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OpenDiagramActionDelegate.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OpenDiagramActionDelegate.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OpenDiagramActionDelegate.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -30,30 +30,31 @@
import org.hibernate.mapping.RootClass;
import org.jboss.tools.hibernate.ui.view.ViewPlugin;
+@SuppressWarnings("restriction")
public class OpenDiagramActionDelegate extends OpenActionDelegate {
- private HashMap hashMap = new HashMap();
+ private HashMap<Object, ObjectEditorInput> hashMap = new HashMap<Object, ObjectEditorInput>();
public void run(IAction action) {
ObjectPluginAction objectPluginAction = (ObjectPluginAction)action;
- Map mapCC_PCs = new HashMap();
+ Map<ConsoleConfiguration, Set<PersistentClass>> mapCC_PCs = new HashMap<ConsoleConfiguration, Set<PersistentClass>>();
TreePath[] paths = ((TreeSelection)objectPluginAction.getSelection()).getPaths();
for (int i = 0; i < paths.length; i++) {
Object last_el = paths[i].getLastSegment();
if (last_el instanceof PersistentClass) {
PersistentClass persClass = (PersistentClass) last_el;
ConsoleConfiguration consoleConfiguration = (ConsoleConfiguration)(paths[i].getFirstSegment());
- Set setPC = (Set)mapCC_PCs.get(consoleConfiguration);
+ Set<PersistentClass> setPC = mapCC_PCs.get(consoleConfiguration);
if (null == setPC) {
- setPC = new HashSet();
+ setPC = new HashSet<PersistentClass>();
mapCC_PCs.put(consoleConfiguration, setPC);
}
setPC.add(persClass);
}
}
- for (Iterator it = mapCC_PCs.keySet().iterator(); it.hasNext(); ) {
- ConsoleConfiguration consoleConfiguration = (ConsoleConfiguration)it.next();
- Set setPC = (Set)mapCC_PCs.get(consoleConfiguration);
+ for (Iterator<ConsoleConfiguration> it = mapCC_PCs.keySet().iterator(); it.hasNext(); ) {
+ ConsoleConfiguration consoleConfiguration = it.next();
+ Set<PersistentClass> setPC = mapCC_PCs.get(consoleConfiguration);
try {
openEditor(setPC, consoleConfiguration);
} catch (PartInitException e) {
@@ -64,7 +65,7 @@
public IEditorPart openEditor(PersistentClass persClass,
ConsoleConfiguration consoleConfiguration) throws PartInitException {
- ObjectEditorInput input = (ObjectEditorInput)hashMap.get(persClass.getRootClass());
+ ObjectEditorInput input = hashMap.get(persClass.getRootClass());
IJavaProject proj = ProjectUtils.findJavaProject(consoleConfiguration);
@@ -77,7 +78,7 @@
return IDE.openEditor(ViewPlugin.getPage(),input ,"org.jboss.tools.hibernate.ui.veditor.editors.visualeditor"); //$NON-NLS-1$
}
- public IEditorPart openEditor(Set setPC, ConsoleConfiguration consoleConfiguration) throws PartInitException {
+ public IEditorPart openEditor(Set<PersistentClass> setPC, ConsoleConfiguration consoleConfiguration) throws PartInitException {
if (0 >= setPC.size()) {
return null;
@@ -87,13 +88,13 @@
String id = ""; //$NON-NLS-1$
PersistentClass persClass = null;
int i = 0;
- for (Iterator it = setPC.iterator(); it.hasNext(); ) {
- persClass = (PersistentClass)it.next();
+ for (Iterator<PersistentClass> it = setPC.iterator(); it.hasNext(); ) {
+ persClass = it.next();
id += "@" + persClass.toString(); //$NON-NLS-1$
rcArr[i++] = persClass.getRootClass();
}
- ObjectEditorInput input = (ObjectEditorInput)hashMap.get(id);
+ ObjectEditorInput input = hashMap.get(id);
IJavaProject proj = ProjectUtils.findJavaProject(consoleConfiguration);
if (null == input) {
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmLabelProvider.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmLabelProvider.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmLabelProvider.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -42,7 +42,7 @@
public class OrmLabelProvider extends LabelProvider implements IColorProvider, IFontProvider {
- private Map imageCache = new HashMap(25);
+ private Map<ImageDescriptor, Image> imageCache = new HashMap<ImageDescriptor, Image>(25);
private OrmModelImageVisitor ormModelImageVisitor;
private OrmModelNameVisitor ormModelNameVisitor;
@@ -87,7 +87,7 @@
return null;
}
- Image image = (Image) imageCache.get(descriptor);
+ Image image = imageCache.get(descriptor);
if (image == null) {
image = descriptor.createImage();
imageCache.put(descriptor, image);
@@ -173,8 +173,8 @@
}
public void dispose() {
- for (Iterator i = imageCache.values().iterator(); i.hasNext();) {
- ((Image) i.next()).dispose();
+ for (Iterator<Image> i = imageCache.values().iterator(); i.hasNext();) {
+ i.next().dispose();
}
imageCache.clear();
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelNameVisitor.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelNameVisitor.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelNameVisitor.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -40,8 +40,8 @@
super();
}
- private Map mappings = new HashMap();
- private Map dialects = new HashMap();
+ private Map<ConsoleConfiguration, Mapping> mappings = new HashMap<ConsoleConfiguration, Mapping>();
+ private Map<String, Dialect> dialects = new HashMap<String, Dialect>();
public Object visitDatabaseColumn(Column column, Object argument) {
@@ -78,7 +78,7 @@
cfg = (ConsoleConfiguration) argument;
if (mappings.containsKey(cfg.getConfiguration())) {
- mapping = (Mapping) mappings.get(cfg);
+ mapping = mappings.get(cfg);
} else {
mapping = cfg.getConfiguration().buildMapping();
mappings.put(cfg, mapping);
@@ -88,7 +88,7 @@
String dialectName = cfg.getConfiguration().getProperty(Environment.DIALECT);
if (dialectName != null) {
if (dialects.containsKey(dialectName)) {
- dialect = (Dialect) dialects.get(dialectName);
+ dialect = dialects.get(dialectName);
} else {
dialect = (Dialect) Class.forName(dialectName).newInstance();
dialects.put(dialectName, dialect);
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ExporterTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ExporterTest.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ExporterTest.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -13,7 +13,7 @@
public class ExporterTest extends TestCase {
- private HashMap map;
+ private HashMap<String, ExporterProperty> map;
private ExporterFactory factory;
private ExporterDefinition definition;
@@ -21,7 +21,7 @@
protected void setUp() throws Exception {
super.setUp();
- map = new HashMap();
+ map = new HashMap<String, ExporterProperty>();
map.put("ejb3", new ExporterProperty("ejb3", "Use ejb3 syntax", "true", true)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
definition = new ExporterDefinition("exporterClass", //$NON-NLS-1$
"exporterDescription", //$NON-NLS-1$
@@ -35,12 +35,12 @@
}
public void testExporters() {
- Map properties = definition.getExporterProperties();
+ Map<String, ExporterProperty> properties = definition.getExporterProperties();
assertEquals(properties, map);
- Map defaultProperties = factory.getDefaultExporterProperties();
+ Map<String, ExporterProperty> defaultProperties = factory.getDefaultExporterProperties();
assertEquals(defaultProperties, map);
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/RefactoringTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/RefactoringTest.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/RefactoringTest.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -43,6 +43,7 @@
* @author Dmitry Geraskov
*
*/
+@SuppressWarnings("restriction")
public class RefactoringTest extends TestCase {
private final String[] oldPathElements = new String[]{"oldPrj","oldSrc", "oldPack", "oldHibernate.cfg.xml"}; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
@@ -229,10 +230,11 @@
assertTrue(count_new == count_old);
}
+ @SuppressWarnings("unchecked")
private void checkPaths(Path truePath) throws CoreException{
String newPath = (String) testStrConfig.getNewAttribute(IConsoleConfigurationLaunchConstants.CFG_XML_FILE);
assertEquals(truePath.makeAbsolute(), new Path(newPath).makeAbsolute());
- newPath = (String) ((List) testStrListConfig.getNewAttribute(IConsoleConfigurationLaunchConstants.FILE_MAPPINGS)).get(0);
+ newPath = ((List<String>) testStrListConfig.getNewAttribute(IConsoleConfigurationLaunchConstants.FILE_MAPPINGS)).get(0);
assertEquals(truePath.makeAbsolute(), new Path(newPath).makeAbsolute());
}
@@ -268,6 +270,7 @@
}
//====================================================================================
+ @SuppressWarnings("unchecked")
static class TestWorkingCopy implements ILaunchConfigurationWorkingCopy{
private TestLaunchConfig parent;
@@ -307,6 +310,7 @@
return true;
}
+
public void removeModes(Set modes) {}
public void rename(String name) {}
@@ -473,6 +477,7 @@
}
+ @SuppressWarnings("unchecked")
static class TestLaunchConfig implements ILaunchConfiguration{
private Map<String, Object> attributes = new HashMap<String, Object>();
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/ProjectUtil.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/ProjectUtil.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/ProjectUtil.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -44,6 +44,7 @@
* @author Dmitry Geraskov
*
*/
+@SuppressWarnings("restriction")
public class ProjectUtil {
private static final StringBuilder XML_HEADER = new StringBuilder("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n") //$NON-NLS-1$
@@ -127,7 +128,7 @@
ConsoleConfigurationWizardPage page = ((ConsoleConfigurationWizardPage)getPages()[0]);
ILaunchConfigurationTab[] tabs = page.getTabs();
ConsoleConfigurationMainTab main = (ConsoleConfigurationMainTab) tabs[0];
- Class clazz = main.getClass();
+ Class<? extends ConsoleConfigurationMainTab> clazz = main.getClass();
Field projectName = clazz.getDeclaredField("projectNameText"); //$NON-NLS-1$
projectName.setAccessible(true);
Text text = (Text) projectName.get(main);
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/xpl/JavaProjectHelper.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/xpl/JavaProjectHelper.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/xpl/JavaProjectHelper.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -24,8 +24,6 @@
import java.util.Map;
import java.util.zip.ZipFile;
-import junit.framework.Assert;
-
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
@@ -56,12 +54,12 @@
import org.eclipse.ui.dialogs.IOverwriteQuery;
import org.eclipse.ui.wizards.datatransfer.ImportOperation;
import org.eclipse.ui.wizards.datatransfer.ZipFileStructureProvider;
-import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.test.HibernateConsoleTestPlugin;
/**
* Helper methods to set up a IJavaProject.
*/
+@SuppressWarnings("restriction")
public class JavaProjectHelper {
@@ -114,8 +112,9 @@
* Sets the compiler options to 1.5 for the given project.
* @param project the java project
*/
+ @SuppressWarnings("unchecked")
public static void set15CompilerOptions(IJavaProject project) {
- Map options= project.getOptions(false);
+ Map<String,String> options= project.getOptions(false);
JavaProjectHelper.set15CompilerOptions(options);
project.setOptions(options);
}
@@ -124,8 +123,9 @@
* Sets the compiler options to 1.4 for the given project.
* @param project the java project
*/
+ @SuppressWarnings("unchecked")
public static void set14CompilerOptions(IJavaProject project) {
- Map options= project.getOptions(false);
+ Map<String,String> options= project.getOptions(false);
JavaProjectHelper.set14CompilerOptions(options);
project.setOptions(options);
}
@@ -134,7 +134,7 @@
* Sets the compiler options to 1.5
* @param options The compiler options to configure
*/
- public static void set15CompilerOptions(Map options) {
+ public static void set15CompilerOptions(Map<String,String> options) {
options.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_5);
options.put(JavaCore.COMPILER_PB_ASSERT_IDENTIFIER, JavaCore.ERROR);
options.put(JavaCore.COMPILER_PB_ENUM_IDENTIFIER, JavaCore.ERROR);
@@ -146,7 +146,7 @@
* Sets the compiler options to 1.4
* @param options The compiler options to configure
*/
- public static void set14CompilerOptions(Map options) {
+ public static void set14CompilerOptions(Map<String,String> options) {
options.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_4);
options.put(JavaCore.COMPILER_PB_ASSERT_IDENTIFIER, JavaCore.ERROR);
options.put(JavaCore.COMPILER_PB_ENUM_IDENTIFIER, JavaCore.WARNING);
@@ -158,7 +158,7 @@
* Sets the compiler options to 1.3
* @param options The compiler options to configure
*/
- public static void set13CompilerOptions(Map options) {
+ public static void set13CompilerOptions(Map<String,String> options) {
options.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_3);
options.put(JavaCore.COMPILER_PB_ASSERT_IDENTIFIER, JavaCore.WARNING);
options.put(JavaCore.COMPILER_PB_ENUM_IDENTIFIER, JavaCore.WARNING);
@@ -578,10 +578,11 @@
* @throws CoreException import failed
* @throws IOException import failed
*/
+ @SuppressWarnings("unchecked")
public static void importResources(IContainer importTarget, String bundleSourcePath) throws CoreException, IOException {
- Enumeration entryPaths= HibernateConsoleTestPlugin.getDefault().getBundle().getEntryPaths(bundleSourcePath);
+ Enumeration<String> entryPaths= HibernateConsoleTestPlugin.getDefault().getBundle().getEntryPaths(bundleSourcePath);
while (entryPaths.hasMoreElements()) {
- String path= (String) entryPaths.nextElement();
+ String path= entryPaths.nextElement();
IPath name= new Path(path.substring(bundleSourcePath.length()));
if (path.endsWith("/")) { //$NON-NLS-1$
IFolder folder= importTarget.getFolder(name);
Modified: trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/SwtUtils.java
===================================================================
--- trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/SwtUtils.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/SwtUtils.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -18,7 +18,7 @@
*
*/
public class SwtUtils {
- public static Control findControlByClass(Composite comp, Class claz) {
+ public static Control findControlByClass(Composite comp, Class<? extends Control> claz) {
for (Control child : comp.getChildren()) {
if(child.getClass()==claz) {
return child;
Modified: trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/tests/TestSuiteWithParams.java
===================================================================
--- trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/tests/TestSuiteWithParams.java 2009-05-22 10:14:44 UTC (rev 15399)
+++ trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/tests/TestSuiteWithParams.java 2009-05-22 10:53:12 UTC (rev 15400)
@@ -20,7 +20,7 @@
Properties parameters = new Properties();
- public TestSuiteWithParams(Class theClass, Properties params) {
+ public TestSuiteWithParams(Class<?> theClass, Properties params) {
super(theClass);
this.parameters.putAll(params);
}
15 years, 4 months
JBoss Tools SVN: r15399 - trunk/as/docs/reference/en/images/perspective.
by jbosstools-commits@lists.jboss.org
Author: chukhutsina
Date: 2009-05-22 06:14:44 -0400 (Fri, 22 May 2009)
New Revision: 15399
Modified:
trunk/as/docs/reference/en/images/perspective/perspective_4.png
trunk/as/docs/reference/en/images/perspective/perspective_5.png
Log:
<html><head><meta name="qrichtext" content="1" /></head><body style="font-size:9pt;font-family:Sans Serif">
<p>https://jira.jboss.org/jira/browse/JBDS-733 -According to the new features of the Server Editor the screens where it's used were updated. </p>
</body></html>
Modified: trunk/as/docs/reference/en/images/perspective/perspective_4.png
===================================================================
(Binary files differ)
Modified: trunk/as/docs/reference/en/images/perspective/perspective_5.png
===================================================================
(Binary files differ)
15 years, 4 months
JBoss Tools SVN: r15398 - trunk/documentation/guides/GettingStartedGuide/en/images/manage.
by jbosstools-commits@lists.jboss.org
Author: chukhutsina
Date: 2009-05-22 06:13:38 -0400 (Fri, 22 May 2009)
New Revision: 15398
Modified:
trunk/documentation/guides/GettingStartedGuide/en/images/manage/manage_8.png
Log:
<html><head><meta name="qrichtext" content="1" /></head><body style="font-size:9pt;font-family:Sans Serif">
<p>https://jira.jboss.org/jira/browse/JBDS-733 -According to the new features of the Server Editor the screen where it's used was updated. </p>
</body></html>
Modified: trunk/documentation/guides/GettingStartedGuide/en/images/manage/manage_8.png
===================================================================
(Binary files differ)
15 years, 4 months