GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |
GeezerVison is showing github.com — ADD: SelfShowableContent - a new kind of opening outcome by xulman · Pull Request #473 · scijava/scijava-common ConversationIt is often used in conjuction with openers that do load-and-show on their own, Requires a patch on the Example code package sc.fiji.ome.zarr.fiji.ui; import net.imagej.ImageJ; import org.scijava.io.AbstractIOPlugin; import org.scijava.io.IOPlugin; import org.scijava.io.location.Location; import org.scijava.plugin.Attr; import org.scijava.plugin.Plugin; import org.scijava.ui.SelfShowableContent; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; @Plugin(type = IOPlugin.class, attrs = @Attr(name = "eager")) public class MinimalFolderOpeningExample extends AbstractIOPlugin<Object> { @Override public boolean supportsOpen(Location source) { System.out.println(this.getClass().getName() + " is considering the file "+source); // final Path filePath = Paths.get(source.getURI()); boolean canOpen = Files.isDirectory(filePath) && filePath.toString().endsWith(".xyz"); System.out.println(this.getClass().getName() + " says canOpen = " + canOpen); return canOpen; } @Override public Object open(Location source) throws IOException { final String message = this.getClass().getName() + " is opening the file "+source; return new SelfShowableContent<>( source.toString(), m -> System.out.println("I just took care of the .xyz folder: "+m) ); } @Override public Class<Object> getDataType() { return Object.class; } public static void main(String[] args) { ImageJ ij = new ImageJ(); ij.ui().showUI(); } }
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
This was referenced
ctrueden
force-pushed
the
master
branch
3 times, most recently
from
53b6733 to
3dc99c9
Compare
It is often used in conjuction with openers that do load-and-show on their own, as opposite to load-only-and-have-Fiji-to-show pattern.
xulman
force-pushed
the
SelfShowableContent
branch
from
cdc04ef to
13626d1
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersNo reviewsUh oh!
There was an error while loading. Please reload this page. AssigneesLabels
None yet
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later. | |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |