Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: turesheim/elibrarium
base: d81e5f32ae
...
head fork: turesheim/elibrarium
compare: 62d4e5de7c
  • 4 commits
  • 21 files changed
  • 0 commit comments
  • 1 contributor
Showing with 93 additions and 85 deletions.
  1. +9 −3 no.resheim.elibrarium.epub-feature/feature.properties
  2. +1 −1  no.resheim.elibrarium.epub.core/META-INF/MANIFEST.MF
  3. +7 −7 ...m.elibrarium.epub.core/src/no/resheim/elibrarium/epub/core/{EPUBCorePlugin.java → EpubCorePlugin.java}
  4. +4 −4 no.resheim.elibrarium.epub.core/src/no/resheim/elibrarium/epub/core/{EPUBUtil.java → EpubUtil.java}
  5. +8 −8 no.resheim.elibrarium.epub.core/src/no/resheim/elibrarium/epub/core/FolderScanner.java
  6. +1 −1  no.resheim.elibrarium.epub.core/src/no/resheim/elibrarium/epub/core/PreferenceInitializer.java
  7. +1 −0  no.resheim.elibrarium.epub.ui/.classpath
  8. +3 −1 no.resheim.elibrarium.epub.ui/META-INF/MANIFEST.MF
  9. +2 −1  no.resheim.elibrarium.epub.ui/build.properties
  10. BIN  no.resheim.elibrarium.epub.ui/icons/bookmark.png
  11. BIN  no.resheim.elibrarium.epub.ui/icons/bookmark_active.png
  12. BIN  no.resheim.elibrarium.epub.ui/icons/bookmark_inactive.png
  13. BIN  no.resheim.elibrarium.epub.ui/img-src/bookmark.idraw
  14. BIN  no.resheim.elibrarium.epub.ui/lib/prettytime-1.0.8.Final.jar
  15. +1 −1  no.resheim.elibrarium.epub.ui/plugin.xml
  16. +8 −4 no.resheim.elibrarium.epub.ui/src/no/resheim/elibrarium/epub/ui/{EPUBUIPlugin.java → EpubUIPlugin.java}
  17. +2 −2 no.resheim.elibrarium.epub.ui/src/no/resheim/elibrarium/epub/ui/preferences/ScanPreferencePage.java
  18. +1 −1  ...ium.epub.ui/src/no/resheim/elibrarium/epub/ui/reader/{EPUBLabelProvider.java → EpubLabelProvider.java}
  19. +33 −39 ...esheim.elibrarium.epub.ui/src/no/resheim/elibrarium/epub/ui/reader/{EPUBReader.java → EpubReader.java}
  20. +2 −2 no.resheim.elibrarium.epub.ui/src/no/resheim/elibrarium/epub/ui/reader/PaginationJob.java
  21. +10 −10 no.resheim.elibrarium.epub.ui/src/no/resheim/elibrarium/epub/ui/reader/TOCOutlinePage.java
View
12 no.resheim.elibrarium.epub-feature/feature.properties
@@ -11,9 +11,15 @@
featureName=EPUB Reader
description=Adds support for handling and reading EPUB files.\n\
\n\
-The EPUB reader makes use of the Rangy software developed by Tim Down and
-released under the MIT license. Copyright (c) 2011, Tim Down. \n\
-See http://code.google.com/p/rangy/
+The EPUB reader makes use of the the following software:\n\
+\n\
+Rangy developed by Tim Down and released under the MIT license.
+Copyright (c) 2011, Tim Down.\n\
+See http://code.google.com/p/rangy/\n\
+\n\
+PrettyTime developed by OCPsoft and released under the APL license.\n\
+Copyright (c) 2011, Lincoln Baxter, III\n\
+See http://ocpsoft.org/prettytime
providerName=Torkild U. Resheim
copyright=Copyright (c) 2011, 2012 Torkild U. Resheim. All rights reserved.
license=\
View
2  no.resheim.elibrarium.epub.core/META-INF/MANIFEST.MF
@@ -8,6 +8,6 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.mylyn.docs.epub.core;bundle-version="0.8.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Export-Package: no.resheim.elibrarium.epub.core
-Bundle-Activator: no.resheim.elibrarium.epub.core.EPUBCorePlugin
+Bundle-Activator: no.resheim.elibrarium.epub.core.EpubCorePlugin
Bundle-Vendor: Torkild U. Resheim
Bundle-ActivationPolicy: lazy
View
14 .../elibrarium/epub/core/EPUBCorePlugin.java → .../elibrarium/epub/core/EpubCorePlugin.java
@@ -33,7 +33,7 @@
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
-public class EPUBCorePlugin extends Plugin implements BundleActivator, ICollection, IPreferenceChangeListener {
+public class EpubCorePlugin extends Plugin implements BundleActivator, ICollection, IPreferenceChangeListener {
public static final String PLUGIN_ID = "no.resheim.elibrarium.epub.core";
@@ -41,7 +41,7 @@
public static final String COLLECTION_ID = "no.resheim.elibrarium.epub";
- private static EPUBCorePlugin collection;
+ private static EpubCorePlugin collection;
private final FolderScanner scanner;
@@ -57,7 +57,7 @@ public Scheduler(FolderScanner scanner) {
public void done(IJobChangeEvent event) {
super.done(event);
if (isDiscoveryEnabled()) {
- IEclipsePreferences preferences = InstanceScope.INSTANCE.getNode(EPUBCorePlugin.PLUGIN_ID);
+ IEclipsePreferences preferences = InstanceScope.INSTANCE.getNode(EpubCorePlugin.PLUGIN_ID);
int minutes = preferences.getInt(PreferenceConstants.SCAN_INTERVAL,
PreferenceConstants.DEFAULT_SCAN_INTERVAL);
scanner.schedule(60000 * minutes);
@@ -67,17 +67,17 @@ public void done(IJobChangeEvent event) {
}
private boolean isDiscoveryEnabled() {
- IEclipsePreferences preferences = InstanceScope.INSTANCE.getNode(EPUBCorePlugin.PLUGIN_ID);
+ IEclipsePreferences preferences = InstanceScope.INSTANCE.getNode(EpubCorePlugin.PLUGIN_ID);
return preferences.getBoolean(PreferenceConstants.SCAN_ENABLE, false);
}
- public EPUBCorePlugin() {
+ public EpubCorePlugin() {
collection = this;
listeners = new ListenerList();
scanner = new FolderScanner("Scanning");
}
- public static EPUBCorePlugin getCollection() {
+ public static EpubCorePlugin getCollection() {
return collection;
}
@@ -85,7 +85,7 @@ public static EPUBCorePlugin getCollection() {
public void start(BundleContext context) throws Exception {
super.start(context);
scanner.addJobChangeListener(new Scheduler(scanner));
- IEclipsePreferences preferences = InstanceScope.INSTANCE.getNode(EPUBCorePlugin.PLUGIN_ID);
+ IEclipsePreferences preferences = InstanceScope.INSTANCE.getNode(EpubCorePlugin.PLUGIN_ID);
preferences.addPreferenceChangeListener(this);
LibraryPlugin.getDefault().addCollection(this);
if (isDiscoveryEnabled()) {
View
8 ...esheim/elibrarium/epub/core/EPUBUtil.java → ...esheim/elibrarium/epub/core/EpubUtil.java
@@ -30,7 +30,7 @@
*
* @author Torkild U. Resheim
*/
-public class EPUBUtil {
+public class EpubUtil {
private static final EStructuralFeature TEXT = XMLTypePackage.eINSTANCE.getXMLTypeDocumentRoot_Text();
@@ -43,11 +43,11 @@
* @return the book or <code>null</code>
*/
public static Book getBook(OPSPublication ops) {
- String id = EPUBUtil.getIdentifier(ops);
- if (!EPUBCorePlugin.getCollection().hasBook(id)) {
+ String id = EpubUtil.getIdentifier(ops);
+ if (!EpubCorePlugin.getCollection().hasBook(id)) {
return null;
} else {
- return EPUBCorePlugin.getCollection().getBook(id);
+ return EpubCorePlugin.getCollection().getBook(id);
}
}
View
16 no.resheim.elibrarium.epub.core/src/no/resheim/elibrarium/epub/core/FolderScanner.java
@@ -49,18 +49,18 @@ private void registerBooks(File epubPath) throws Exception {
epub.unpack(epubPath);
List<OPSPublication> publications = epub.getOPSPublications();
for (OPSPublication ops : publications) {
- String title = EPUBUtil.getFirstTitle(ops);
- String author = EPUBUtil.getFirstAuthor(ops);
- String id = EPUBUtil.getIdentifier(ops);
- if (!EPUBCorePlugin.getCollection().hasBook(id)) {
+ String title = EpubUtil.getFirstTitle(ops);
+ String author = EpubUtil.getFirstAuthor(ops);
+ String id = EpubUtil.getIdentifier(ops);
+ if (!EpubCorePlugin.getCollection().hasBook(id)) {
URI uri = epubPath.toURI();
- Book book = LibraryUtil.createNewBook(EPUBCorePlugin.COLLECTION_ID, uri, id, title, author);
+ Book book = LibraryUtil.createNewBook(EpubCorePlugin.COLLECTION_ID, uri, id, title, author);
// Mark the book as automatically discovered
Metadata md = LibraryFactory.eINSTANCE.createMetadata();
md.setKey("discovered");
md.setKey(Boolean.toString(true));
book.getMetadata().add(md);
- EPUBCorePlugin.getCollection().add(book);
+ EpubCorePlugin.getCollection().add(book);
}
}
@@ -68,7 +68,7 @@ private void registerBooks(File epubPath) throws Exception {
@Override
protected IStatus run(IProgressMonitor monitor) {
- IEclipsePreferences preferences = InstanceScope.INSTANCE.getNode(EPUBCorePlugin.PLUGIN_ID);
+ IEclipsePreferences preferences = InstanceScope.INSTANCE.getNode(EpubCorePlugin.PLUGIN_ID);
boolean scan = preferences.getBoolean(PreferenceConstants.SCAN_ENABLE, false);
if (scan){
String paths = preferences.get(PreferenceConstants.SCAN_FOLDERS, "");
@@ -88,7 +88,7 @@ public boolean accept(File dir, String name) {
});
for (File file : epubs) {
- if (!EPUBCorePlugin.getCollection().hasBook(file)) {
+ if (!EpubCorePlugin.getCollection().hasBook(file)) {
try {
registerBooks(file);
} catch (Exception e) {
View
2  ...sheim.elibrarium.epub.core/src/no/resheim/elibrarium/epub/core/PreferenceInitializer.java
@@ -19,7 +19,7 @@
@Override
public void initializeDefaultPreferences() {
- IEclipsePreferences preferences = DefaultScope.INSTANCE.getNode(EPUBCorePlugin.PLUGIN_ID);
+ IEclipsePreferences preferences = DefaultScope.INSTANCE.getNode(EpubCorePlugin.PLUGIN_ID);
preferences.putBoolean(PreferenceConstants.SCAN_FOLDERS, false);
preferences.putBoolean(PreferenceConstants.SCAN_NOTIFY, true);
preferences.putInt(PreferenceConstants.SCAN_INTERVAL, 10);
View
1  no.resheim.elibrarium.epub.ui/.classpath
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
+ <classpathentry exported="true" kind="lib" path="lib/prettytime-1.0.8.Final.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
View
4 no.resheim.elibrarium.epub.ui/META-INF/MANIFEST.MF
@@ -19,7 +19,9 @@ Require-Bundle: org.eclipse.core.runtime,
no.resheim.elibrarium.library.ui;bundle-version="1.0.0"
Import-Package: org.eclipse.ui.internal.browser
Bundle-ActivationPolicy: lazy
-Bundle-Activator: no.resheim.elibrarium.epub.ui.EPUBUIPlugin
+Bundle-Activator: no.resheim.elibrarium.epub.ui.EpubUIPlugin
Export-Package: no.resheim.elibrarium.epub.ui,
no.resheim.elibrarium.epub.ui.preferences,
no.resheim.elibrarium.epub.ui.reader
+Bundle-ClassPath: lib/prettytime-1.0.8.Final.jar,
+ .
View
3  no.resheim.elibrarium.epub.ui/build.properties
@@ -3,4 +3,5 @@ output.. = bin/
bin.includes = META-INF/,\
.,\
icons/,\
- plugin.xml
+ plugin.xml,\
+ lib/prettytime-1.0.8.Final.jar
View
BIN  no.resheim.elibrarium.epub.ui/icons/bookmark.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  no.resheim.elibrarium.epub.ui/icons/bookmark_active.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  no.resheim.elibrarium.epub.ui/icons/bookmark_inactive.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  no.resheim.elibrarium.epub.ui/img-src/bookmark.idraw
Binary file not shown
View
BIN  no.resheim.elibrarium.epub.ui/lib/prettytime-1.0.8.Final.jar
Binary file not shown
View
2  no.resheim.elibrarium.epub.ui/plugin.xml
@@ -5,7 +5,7 @@
<extension
point="org.eclipse.ui.editors">
<editor
- class="no.resheim.elibrarium.epub.ui.reader.EPUBReader"
+ class="no.resheim.elibrarium.epub.ui.reader.EpubReader"
contributorClass="org.eclipse.ui.texteditor.BasicTextEditorActionContributor"
default="true"
extensions="epub"
View
12 ...heim/elibrarium/epub/ui/EPUBUIPlugin.java → ...heim/elibrarium/epub/ui/EpubUIPlugin.java
@@ -22,7 +22,7 @@
* @author Torkild U. Resheim
*
*/
-public class EPUBUIPlugin extends AbstractUIPlugin {
+public class EpubUIPlugin extends AbstractUIPlugin {
/** Image for an inactive bookmark */
public static final String IMG_BOOKMARK_INACTIVE = "img_bookmark_inactive";
@@ -30,7 +30,10 @@
/** Image for an active bookmark */
public static final String IMG_BOOKMARK_ACTIVE = "img_bookmark_active";
- public EPUBUIPlugin() {
+ /** Image for an active bookmark */
+ public static final String IMG_BOOKMARK = "img_bookmark";
+
+ public EpubUIPlugin() {
plugin = this;
}
@@ -41,11 +44,11 @@ public EPUBUIPlugin() {
*
* @return the shared instance
*/
- public static EPUBUIPlugin getDefault() {
+ public static EpubUIPlugin getDefault() {
return plugin;
}
- private static EPUBUIPlugin plugin;
+ private static EpubUIPlugin plugin;
@Override
protected void initializeImageRegistry(ImageRegistry reg) {
@@ -53,6 +56,7 @@ protected void initializeImageRegistry(ImageRegistry reg) {
reg.put(IMG_BOOKMARK_ACTIVE, LibraryUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, "icons/bookmark_active.png"));
reg.put(IMG_BOOKMARK_INACTIVE,
LibraryUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, "icons/bookmark_inactive.png"));
+ reg.put(IMG_BOOKMARK, LibraryUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, "icons/bookmark.png"));
}
}
View
4 ....elibrarium.epub.ui/src/no/resheim/elibrarium/epub/ui/preferences/ScanPreferencePage.java
@@ -11,7 +11,7 @@
*******************************************************************************/
package no.resheim.elibrarium.epub.ui.preferences;
-import no.resheim.elibrarium.epub.core.EPUBCorePlugin;
+import no.resheim.elibrarium.epub.core.EpubCorePlugin;
import no.resheim.elibrarium.epub.core.PreferenceConstants;
import org.eclipse.core.runtime.preferences.InstanceScope;
@@ -66,7 +66,7 @@ public void createFieldEditors() {
public void init(IWorkbench workbench) {
if (preferences == null) {
- preferences = new ScopedPreferenceStore(InstanceScope.INSTANCE, EPUBCorePlugin.PLUGIN_ID);
+ preferences = new ScopedPreferenceStore(InstanceScope.INSTANCE, EpubCorePlugin.PLUGIN_ID);
}
setPreferenceStore(preferences);
}
View
2  ...ium/epub/ui/reader/EPUBLabelProvider.java → ...ium/epub/ui/reader/EpubLabelProvider.java
@@ -25,7 +25,7 @@
*
* @author Torkild U. Resheim
*/
-public class EPUBLabelProvider extends LabelProvider {
+public class EpubLabelProvider extends LabelProvider {
private static final EStructuralFeature TEXT = XMLTypePackage.eINSTANCE.getXMLTypeDocumentRoot_Text();
View
72 ...elibrarium/epub/ui/reader/EPUBReader.java → ...elibrarium/epub/ui/reader/EpubReader.java
@@ -20,9 +20,9 @@
import java.util.Date;
import java.util.UUID;
-import no.resheim.elibrarium.epub.core.EPUBCorePlugin;
-import no.resheim.elibrarium.epub.core.EPUBUtil;
-import no.resheim.elibrarium.epub.ui.EPUBUIPlugin;
+import no.resheim.elibrarium.epub.core.EpubCorePlugin;
+import no.resheim.elibrarium.epub.core.EpubUtil;
+import no.resheim.elibrarium.epub.ui.EpubUIPlugin;
import no.resheim.elibrarium.library.Annotation;
import no.resheim.elibrarium.library.AnnotationColor;
import no.resheim.elibrarium.library.Book;
@@ -71,7 +71,6 @@
import org.eclipse.swt.events.MouseListener;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
@@ -94,7 +93,7 @@
*
* @author Torkild U. Resheim
*/
-public class EPUBReader extends EditorPart {
+public class EpubReader extends EditorPart {
/**
* The direction of browsing.
@@ -316,13 +315,11 @@ public void run() {
private boolean disposed;
- private Label header;
-
- protected Image image;
+ private Label headerLabel;
protected String initialURL;
- private Label label;
+ private Label footerLabel;
int lastHeight;
@@ -351,7 +348,7 @@ public void run() {
private Label bookmarkLabel;
- public EPUBReader() {
+ public EpubReader() {
super();
}
@@ -363,7 +360,7 @@ public boolean close() {
final boolean[] result = new boolean[1];
Display.getDefault().asyncExec(new Runnable() {
public void run() {
- result[0] = getEditorSite().getPage().closeEditor(EPUBReader.this, false);
+ result[0] = getEditorSite().getPage().closeEditor(EpubReader.this, false);
}
});
return result[0];
@@ -384,17 +381,17 @@ public void createPartControl(Composite parent) {
GridData gdHeader = new GridData(SWT.CENTER, SWT.TOP, true, false);
gdHeader.minimumWidth = 500;
- header = new Label(c, SWT.CENTER);
- header.setLayoutData(gdHeader);
- header.setText(" ");
- header.setForeground(JFaceResources.getColorRegistry().get(JFacePreferences.QUALIFIER_COLOR));
+ headerLabel = new Label(c, SWT.CENTER);
+ headerLabel.setLayoutData(gdHeader);
+ headerLabel.setText(" ");
+ headerLabel.setForeground(JFaceResources.getColorRegistry().get(JFacePreferences.QUALIFIER_COLOR));
GridData gdBookmark = new GridData(SWT.CENTER, SWT.BEGINNING, false, false);
gdBookmark.minimumWidth = 32;
gdBookmark.widthHint = 32;
gdBookmark.verticalSpan = 3;
bookmarkLabel = new Label(c, SWT.CENTER);
- bookmarkLabel.setImage(EPUBUIPlugin.getDefault().getImageRegistry().get(EPUBUIPlugin.IMG_BOOKMARK_INACTIVE));
+ bookmarkLabel.setImage(EpubUIPlugin.getDefault().getImageRegistry().get(EpubUIPlugin.IMG_BOOKMARK_INACTIVE));
bookmarkLabel.setLayoutData(gdBookmark);
bookmarkLabel.addMouseListener(new MouseListener() {
@@ -422,11 +419,11 @@ public void mouseDoubleClick(MouseEvent e) {
GridData gdFooter = new GridData(SWT.CENTER, SWT.BOTTOM, true, false);
gdFooter.minimumWidth = 500;
- label = new Label(c, SWT.CENTER);
+ footerLabel = new Label(c, SWT.CENTER);
gdFooter.horizontalSpan = 2;
- label.setLayoutData(gdFooter);
- label.setText(" ");
- label.setForeground(JFaceResources.getColorRegistry().get(JFacePreferences.QUALIFIER_COLOR));
+ footerLabel.setLayoutData(gdFooter);
+ footerLabel.setText(" ");
+ footerLabel.setForeground(JFaceResources.getColorRegistry().get(JFacePreferences.QUALIFIER_COLOR));
// Install listener to figure out when we need to re-paginate
resizeListener = new ResizeListener();
@@ -500,9 +497,6 @@ public void dispose() {
if (paginationJob != null) {
paginationJob.cancel();
}
- if (image != null && !image.isDisposed())
- image.dispose();
- image = null;
// Store the last location
if (currentBook != null) {
currentBook.setLastLocation(currentLocation);
@@ -672,7 +666,7 @@ public void init(IEditorSite site, IEditorInput input) throws PartInitException
setPartName(getTitle(ops));
} catch (Exception e) {
StatusManager.getManager()
- .handle(new Status(IStatus.ERROR, EPUBUIPlugin.PLUGIN_ID, "Could not open book", e),
+ .handle(new Status(IStatus.ERROR, EpubUIPlugin.PLUGIN_ID, "Could not open book", e),
StatusManager.SHOW);
close();
}
@@ -1005,12 +999,12 @@ public void run() {
currentLocation = location;
Bookmark b = hasBookmark();
if (b != null) {
- bookmarkLabel.setImage(EPUBUIPlugin.getDefault().getImageRegistry()
- .get(EPUBUIPlugin.IMG_BOOKMARK_ACTIVE));
+ bookmarkLabel.setImage(EpubUIPlugin.getDefault().getImageRegistry()
+ .get(EpubUIPlugin.IMG_BOOKMARK_ACTIVE));
bookmarkLabel.setToolTipText(b.getText() + "\n(Click to remove bookmark)");
} else {
- bookmarkLabel.setImage(EPUBUIPlugin.getDefault().getImageRegistry()
- .get(EPUBUIPlugin.IMG_BOOKMARK_INACTIVE));
+ bookmarkLabel.setImage(EpubUIPlugin.getDefault().getImageRegistry()
+ .get(EpubUIPlugin.IMG_BOOKMARK_INACTIVE));
bookmarkLabel.setToolTipText("Click to add bookmark");
}
} catch (Exception e) {
@@ -1028,7 +1022,7 @@ public void run() {
sb.append((char) c);
sb.append(' ');
}
- header.setText(sb.toString());
+ headerLabel.setText(sb.toString());
} catch (IOException e) {
e.printStackTrace();
}
@@ -1036,14 +1030,14 @@ public void run() {
});
// Update page number
- label.getDisplay().asyncExec(new Runnable() {
+ footerLabel.getDisplay().asyncExec(new Runnable() {
@Override
public void run() {
synchronized (paginationJob) {
if (paginationJob.getState() == Job.NONE) {
- label.setText("Page " + getCurrentPage() + " of " + paginationJob.getTotalpages());
+ footerLabel.setText("Page " + getCurrentPage() + " of " + paginationJob.getTotalpages());
} else {
- label.setText("Paginating...");
+ footerLabel.setText("Paginating...");
}
}
}
@@ -1156,15 +1150,15 @@ private void readJS(String filename, StringBuilder sb) throws IOException {
}
private void registerBook(IPath path, OPSPublication ops) {
- String title = EPUBUtil.getFirstTitle(ops);
- String author = EPUBUtil.getFirstAuthor(ops);
- String id = EPUBUtil.getIdentifier(ops);
- if (!EPUBCorePlugin.getCollection().hasBook(id)) {
+ String title = EpubUtil.getFirstTitle(ops);
+ String author = EpubUtil.getFirstAuthor(ops);
+ String id = EpubUtil.getIdentifier(ops);
+ if (!EpubCorePlugin.getCollection().hasBook(id)) {
URI uri = path.toFile().toURI();
- currentBook = LibraryUtil.createNewBook(EPUBCorePlugin.COLLECTION_ID, uri, id, title, author);
- EPUBCorePlugin.getCollection().add(currentBook);
+ currentBook = LibraryUtil.createNewBook(EpubCorePlugin.COLLECTION_ID, uri, id, title, author);
+ EpubCorePlugin.getCollection().add(currentBook);
} else {
- currentBook = EPUBCorePlugin.getCollection().getBook(id);
+ currentBook = EpubCorePlugin.getCollection().getBook(id);
}
}
View
4 no.resheim.elibrarium.epub.ui/src/no/resheim/elibrarium/epub/ui/reader/PaginationJob.java
@@ -19,7 +19,7 @@
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
-import no.resheim.elibrarium.epub.core.EPUBUtil;
+import no.resheim.elibrarium.epub.core.EpubUtil;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -171,7 +171,7 @@ public int getWidth() {
private final Shell shell;
public PaginationJob(OPSPublication ops) {
- super(MessageFormat.format("Paginating \"{0}\"", EPUBUtil.getFirstTitle(ops)));
+ super(MessageFormat.format("Paginating \"{0}\"", EpubUtil.getFirstTitle(ops)));
this.ops = ops;
shell = new Shell();
browser = new Browser(shell, SWT.NONE);
View
20 no.resheim.elibrarium.epub.ui/src/no/resheim/elibrarium/epub/ui/reader/TOCOutlinePage.java
@@ -11,8 +11,8 @@
*******************************************************************************/
package no.resheim.elibrarium.epub.ui.reader;
-import no.resheim.elibrarium.epub.core.EPUBUtil;
-import no.resheim.elibrarium.epub.ui.EPUBUIPlugin;
+import no.resheim.elibrarium.epub.core.EpubUtil;
+import no.resheim.elibrarium.epub.ui.EpubUIPlugin;
import no.resheim.elibrarium.library.Annotation;
import no.resheim.elibrarium.library.Book;
import no.resheim.elibrarium.library.Bookmark;
@@ -89,7 +89,7 @@ public void inputChanged(Viewer v, Object oldInput, Object newInput) {
private Composite pagebook;
- private final EPUBReader reader;
+ private final EpubReader reader;
private final ListenerList selectionChangedListeners = new ListenerList();
@@ -99,7 +99,7 @@ public void inputChanged(Viewer v, Object oldInput, Object newInput) {
private TreeViewer toc;
- public TOCOutlinePage(OPSPublication epub, EPUBReader reader) {
+ public TOCOutlinePage(OPSPublication epub, EpubReader reader) {
this.ops = epub;
this.reader = reader;
}
@@ -111,7 +111,7 @@ public void addSelectionChangedListener(ISelectionChangedListener listener) {
@Override
public void createControl(Composite parent) {
- Book book = EPUBUtil.getBook(ops);
+ Book book = EpubUtil.getBook(ops);
pagebook = new Composite(parent, SWT.NONE);
layout = new StackLayout();
@@ -119,13 +119,13 @@ public void createControl(Composite parent) {
toc = new TreeViewer(pagebook, getTreeStyle());
toc.setContentProvider(new TOCContentProvider());
- toc.setLabelProvider(new EPUBLabelProvider());
+ toc.setLabelProvider(new EpubLabelProvider());
toc.addSelectionChangedListener(this);
toc.addDoubleClickListener(this);
notes = new AnnotationViewer(pagebook, SWT.FULL_SELECTION);
notes.setContentProvider(new AnnotationsContentProvider());
- notes.setLabelProvider(new EPUBLabelProvider());
+ notes.setLabelProvider(new EpubLabelProvider());
notes.addSelectionChangedListener(this);
notes.addDoubleClickListener(this);
@@ -289,7 +289,7 @@ public void run() {
if (selection instanceof IStructuredSelection) {
Object o = ((IStructuredSelection) selection).getFirstElement();
if (o instanceof Annotation) {
- EPUBUtil.getBook(ops).getBookmarks().remove(o);
+ EpubUtil.getBook(ops).getBookmarks().remove(o);
}
}
}
@@ -298,9 +298,9 @@ public void run() {
deleteAction.setToolTipText("Deletes the note");
- showTOC.setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(EPUBUIPlugin.PLUGIN_ID,
+ showTOC.setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(EpubUIPlugin.PLUGIN_ID,
"icons/contents.gif"));
- showAnnotations.setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(EPUBUIPlugin.PLUGIN_ID,
+ showAnnotations.setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(EpubUIPlugin.PLUGIN_ID,
"icons/marking.gif"));
}

No commit comments for this range

Something went wrong with that request. Please try again.