git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1404642 13f79535-47bb-0310-9956-ffa450edef68pull/2/head
@@ -70,7 +70,7 @@ workbooks then you need to have the following jars in your path:</p> | |||
<typedef resource="org/apache/poi/ss/excelant/antlib.xml" classpathref="excelant.path" /> | |||
]]></source> | |||
<p> | |||
Where excelant.path referes to the classpath with POI jars. | |||
Where excelant.path refers to the classpath with POI jars. | |||
Using this approach the provided extensions will live in the default namespace. Note that the default task/typenames (evaluate, test) may be too generic and should either be explicitly overridden or used with a namespace. | |||
</p> | |||
<ul><li>Similar, but assigning a namespace URI:</li></ul> |
@@ -1437,7 +1437,7 @@ Examples: | |||
CreationHelper createHelper = wb.getCreationHelper(); | |||
//cell style for hyperlinks | |||
//by default hypelrinks are blue and underlined | |||
//by default hyperlinks are blue and underlined | |||
CellStyle hlink_style = wb.createCellStyle(); | |||
Font hlink_font = wb.createFont(); | |||
hlink_font.setUnderline(Font.U_SINGLE); |
@@ -30,13 +30,13 @@ public class HyperlinkExample { | |||
public static void main(String[]args) throws Exception{ | |||
Workbook wb = new XSSFWorkbook(); //or new HSSFWorkbook(); | |||
CreationHelper createHelper = wb.getCreationHelper(); | |||
//cell style for hyperlinks | |||
//by default hypelrinks are blue and underlined | |||
CellStyle hlink_style = wb.createCellStyle(); | |||
Font hlink_font = wb.createFont(); | |||
hlink_font.setUnderline(Font.U_SINGLE); | |||
CreationHelper createHelper = wb.getCreationHelper(); | |||
//cell style for hyperlinks | |||
//by default hyperlinks are blue and underlined | |||
CellStyle hlink_style = wb.createCellStyle(); | |||
Font hlink_font = wb.createFont(); | |||
hlink_font.setUnderline(Font.U_SINGLE); | |||
hlink_font.setColor(IndexedColors.BLUE.getIndex()); | |||
hlink_style.setFont(hlink_font); | |||
@@ -21,7 +21,7 @@ package org.apache.poi.common.usermodel; | |||
*/ | |||
public interface Hyperlink { | |||
/** | |||
* Link to a existing file or web page | |||
* Link to an existing file or web page | |||
*/ | |||
public static final int LINK_URL = 1; | |||
@@ -42,14 +42,14 @@ public interface Hyperlink { | |||
/** | |||
* Hypelink address. Depending on the hyperlink type it can be URL, e-mail, patrh to a file, etc. | |||
* Hyperlink address. Depending on the hyperlink type it can be URL, e-mail, path to a file, etc. | |||
* | |||
* @return the address of this hyperlink | |||
*/ | |||
public String getAddress(); | |||
/** | |||
* Hypelink address. Depending on the hyperlink type it can be URL, e-mail, patrh to a file, etc. | |||
* Hyperlink address. Depending on the hyperlink type it can be URL, e-mail, path to a file, etc. | |||
* | |||
* @param address the address of this hyperlink | |||
*/ |
@@ -24,13 +24,13 @@ import org.apache.poi.ss.usermodel.Hyperlink; | |||
* | |||
* @author Yegor Kozlov (yegor at apache dot org) | |||
*/ | |||
public class HSSFHyperlink implements Hyperlink { | |||
/** | |||
* Link to a existing file or web page | |||
*/ | |||
public static final int LINK_URL = 1; | |||
public class HSSFHyperlink implements Hyperlink { | |||
/** | |||
* Link to an existing file or web page | |||
*/ | |||
public static final int LINK_URL = 1; | |||
/** | |||
* Link to a place in this document | |||
*/ | |||
@@ -49,13 +49,13 @@ public class HSSFHyperlink implements Hyperlink { | |||
/** | |||
* Low-level record object that stores the actual hyperlink data | |||
*/ | |||
protected HyperlinkRecord record = null; | |||
/** | |||
* If we create a new hypelrink remember its type | |||
*/ | |||
protected int link_type; | |||
protected HyperlinkRecord record = null; | |||
/** | |||
* If we create a new hyperlink remember its type | |||
*/ | |||
protected int link_type; | |||
/** | |||
* Construct a new hyperlink | |||
* | |||
@@ -173,13 +173,13 @@ public class HSSFHyperlink implements Hyperlink { | |||
*/ | |||
public void setLastColumn(int col){ | |||
record.setLastColumn((short)col); | |||
} | |||
/** | |||
* Hypelink address. Depending on the hyperlink type it can be URL, e-mail, path to a file, etc. | |||
* | |||
* @return the address of this hyperlink | |||
*/ | |||
} | |||
/** | |||
* Hyperlink address. Depending on the hyperlink type it can be URL, e-mail, path to a file, etc. | |||
* | |||
* @return the address of this hyperlink | |||
*/ | |||
public String getAddress(){ | |||
return record.getAddress(); | |||
} | |||
@@ -187,31 +187,31 @@ public class HSSFHyperlink implements Hyperlink { | |||
return record.getTextMark(); | |||
} | |||
/** | |||
* Convenience method equivalent to {@link #setAddress(String)} | |||
* | |||
* @param textMark the place in worksheet this hypelrink referes to, e.g. 'Target Sheet'!A1' | |||
*/ | |||
public void setTextMark(String textMark) { | |||
record.setTextMark(textMark); | |||
/** | |||
* Convenience method equivalent to {@link #setAddress(String)} | |||
* | |||
* @param textMark the place in worksheet this hyperlink refers to, e.g. 'Target Sheet'!A1' | |||
*/ | |||
public void setTextMark(String textMark) { | |||
record.setTextMark(textMark); | |||
} | |||
public String getShortFilename(){ | |||
return record.getShortFilename(); | |||
} | |||
/** | |||
* Convenience method equivalent to {@link #setAddress(String)} | |||
* | |||
* @param shortFilename the path to a file this hypelrink points to, e.g. 'readme.txt' | |||
*/ | |||
public void setShortFilename(String shortFilename) { | |||
record.setShortFilename(shortFilename); | |||
} | |||
/** | |||
* Hypelink address. Depending on the hyperlink type it can be URL, e-mail, patrh to a file, etc. | |||
* | |||
* @param address the address of this hyperlink | |||
*/ | |||
/** | |||
* Convenience method equivalent to {@link #setAddress(String)} | |||
* | |||
* @param shortFilename the path to a file this hyperlink points to, e.g. 'readme.txt' | |||
*/ | |||
public void setShortFilename(String shortFilename) { | |||
record.setShortFilename(shortFilename); | |||
} | |||
/** | |||
* Hyperlink address. Depending on the hyperlink type it can be URL, e-mail, path to a file, etc. | |||
* | |||
* @param address the address of this hyperlink | |||
*/ | |||
public void setAddress(String address){ | |||
record.setAddress(address); | |||
} |
@@ -906,9 +906,9 @@ public final class XSSFCell implements Cell { | |||
} | |||
/** | |||
* Assign a hypelrink to this cell | |||
* Assign a hyperlink to this cell | |||
* | |||
* @param hyperlink the hypelrink to associate with this cell | |||
* @param hyperlink the hyperlink to associate with this cell | |||
*/ | |||
public void setHyperlink(Hyperlink hyperlink) { | |||
XSSFHyperlink link = (XSSFHyperlink)hyperlink; |
@@ -139,7 +139,7 @@ public class XSSFHyperlink implements Hyperlink { | |||
} | |||
/** | |||
* Hypelink address. Depending on the hyperlink type it can be URL, e-mail, path to a file | |||
* Hyperlink address. Depending on the hyperlink type it can be URL, e-mail, path to a file | |||
* | |||
* @return the address of this hyperlink | |||
*/ |
@@ -20,7 +20,7 @@ | |||
<record id="0x1051" name="LinkedData" excel-record-id="AI" package="org.apache.poi.hssf.record"> | |||
<suffix>Record</suffix> | |||
<extends>Record</extends> | |||
<description>Describes a linked data record. This record referes to the series data or text.</description> | |||
<description>Describes a linked data record. This record refers to the series data or text.</description> | |||
<author>Glen Stampoultzis (glens at apache.org)</author> | |||
<fields> | |||
<field type="int" size="1" name="link type" description="What type of link is this?"> |
@@ -119,7 +119,7 @@ public class Picture extends SimpleShape { | |||
/** | |||
* Create a new Picture and populate the inital structure of the <code>EscherSp</code> record which holds information about this picture. | |||
* @param idx the index of the picture which referes to <code>EscherBSE</code> container. | |||
* @param idx the index of the picture which refers to <code>EscherBSE</code> container. | |||
* @return the create Picture object | |||
*/ | |||
protected EscherContainerRecord createSpContainer(int idx, boolean isChild) { |
@@ -220,19 +220,19 @@ public final class TestHSSFHyperlink extends BaseTestHyperlink { | |||
sheet.shiftRows(sheet.getFirstRowNum(), sheet.getLastRowNum(), 2); | |||
//cells A3 and A4 don't contain hyperlinks anymore | |||
assertNull(sheet.getRow(2).getCell(0).getHyperlink()); | |||
assertNull(sheet.getRow(3).getCell(0).getHyperlink()); | |||
//the first hypelink now belongs to A5 | |||
HSSFHyperlink link1_shifted = sheet.getRow(2+2).getCell(0).getHyperlink(); | |||
assertNotNull(link1_shifted); | |||
assertEquals(4, link1_shifted.getFirstRow()); | |||
assertEquals(4, link1_shifted.getLastRow()); | |||
//the second hypelink now belongs to A6 | |||
HSSFHyperlink link2_shifted = sheet.getRow(3+2).getCell(0).getHyperlink(); | |||
assertNotNull(link2_shifted); | |||
assertEquals(5, link2_shifted.getFirstRow()); | |||
assertNull(sheet.getRow(2).getCell(0).getHyperlink()); | |||
assertNull(sheet.getRow(3).getCell(0).getHyperlink()); | |||
//the first hyperlink now belongs to A5 | |||
HSSFHyperlink link1_shifted = sheet.getRow(2+2).getCell(0).getHyperlink(); | |||
assertNotNull(link1_shifted); | |||
assertEquals(4, link1_shifted.getFirstRow()); | |||
assertEquals(4, link1_shifted.getLastRow()); | |||
//the second hyperlink now belongs to A6 | |||
HSSFHyperlink link2_shifted = sheet.getRow(3+2).getCell(0).getHyperlink(); | |||
assertNotNull(link2_shifted); | |||
assertEquals(5, link2_shifted.getFirstRow()); | |||
assertEquals(5, link2_shifted.getLastRow()); | |||
} | |||
} |