This repository has been archived by the owner on Nov 17, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This implements the image export (save as) functionality. It migrates the toolbar actions away from the old ActionSet mechnanism in favor of the Commands and Handlers framework. This also allows saving of the image as any filename the user wants, but it will always export as PNG.
- Loading branch information
1 parent
6859b33
commit 4c9b317
Showing
12 changed files
with
342 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
101 changes: 0 additions & 101 deletions
101
bundles/us.nineworlds.xstreamer/src/uky/article/imageviewer/actions/PushActionDelegate.java
This file was deleted.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
...les/us.nineworlds.xstreamer/src/uky/article/imageviewer/handlers/ImageViewFitHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package uky.article.imageviewer.handlers; | ||
|
||
import org.eclipse.core.commands.AbstractHandler; | ||
import org.eclipse.core.commands.ExecutionEvent; | ||
import org.eclipse.core.commands.ExecutionException; | ||
import org.eclipse.core.commands.IHandler; | ||
import org.eclipse.ui.IWorkbenchPart; | ||
import org.eclipse.ui.handlers.HandlerUtil; | ||
|
||
import uky.article.imageviewer.views.ImageView; | ||
import uky.article.imageviewer.views.SWTImageCanvas; | ||
|
||
public class ImageViewFitHandler extends AbstractHandler implements IHandler { | ||
|
||
@Override | ||
public Object execute(ExecutionEvent event) throws ExecutionException { | ||
IWorkbenchPart activePart = HandlerUtil.getActivePart(event); | ||
ImageView imageView = (ImageView) activePart; | ||
SWTImageCanvas imageCanvas = imageView.imageCanvas; | ||
if (imageCanvas == null) { | ||
return null; | ||
} | ||
|
||
imageCanvas.fitCanvas(); | ||
|
||
return null; | ||
} | ||
|
||
} |
26 changes: 26 additions & 0 deletions
26
...es/us.nineworlds.xstreamer/src/uky/article/imageviewer/handlers/ImageViewOpenHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package uky.article.imageviewer.handlers; | ||
|
||
import org.eclipse.core.commands.AbstractHandler; | ||
import org.eclipse.core.commands.ExecutionEvent; | ||
import org.eclipse.core.commands.ExecutionException; | ||
import org.eclipse.core.commands.IHandler; | ||
import org.eclipse.ui.IWorkbenchPart; | ||
import org.eclipse.ui.handlers.HandlerUtil; | ||
|
||
import uky.article.imageviewer.views.ImageView; | ||
import uky.article.imageviewer.views.SWTImageCanvas; | ||
|
||
public class ImageViewOpenHandler extends AbstractHandler implements IHandler { | ||
|
||
@Override | ||
public Object execute(ExecutionEvent event) throws ExecutionException { | ||
IWorkbenchPart activePart = HandlerUtil.getActivePart(event); | ||
ImageView imageView = (ImageView) activePart; | ||
SWTImageCanvas imageCanvas = imageView.imageCanvas; | ||
|
||
imageCanvas.onFileOpen(); | ||
|
||
return null; | ||
} | ||
|
||
} |
Oops, something went wrong.