I'm new to eclipse plug-in development, and have a little question here.
I want to open a new view by clicking on an object in an editor. Specifically, the object is a link to an image file, that should be opened in an image viewer. For now, I'm using
ImageViewer viewer = (ImageViewer) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(viewer_ID);
viewer.setSelection(pathToFile);
is this how you would normally do it (both opening the view, and getting the image to it), or is there a better way?
As answered in another question, your code is the way to go, but there's a slightly more stable way to do it within a Handler.
Once you opened the view, you can use any of its API.
Related
I'm developing an eclipse plug-in and I would like to open files with a certain extension (e.g. .xml) with the View tab of my plug-in. Is this possible? I know this can be done for editors like this In plug-in.xml how to associate a file extension with a particular kind of editor in eclipse plug-in.
The difference between a View and an Editor has diminished with Eclipse 4. This means that you can dock editors outside the shared area on a view stack. Go ahead and try it by dragging an Editor by its title and dropping it on a view stack.
Furthermore, it is very well possible to edit files in views if you want to implement this yourself. For this to happen you have to implement ISaveablePart [1] on the view. When you implement this, the view will play in the change/dirty/save editor lifecycle of the workbench.
[1] http://help.eclipse.org/luna/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fapi%2Forg%2Feclipse%2Fui%2FISaveablePart.html
No, it is not possible.
The closest you can get is to add a separate 'open in view' menu item.
Iam making a new view plugin for eclipse and I need it to display a website.
I know there are eclipse views already that does that but I haven't found a way to do it. I know it is very simple using a JFrame or similar but how can I get it to show in an eclipse view?
Thank you
You can use an SWT Browser component, as described at http://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet128.java -- you would need to add the Browser to the view's composite parent when the view is created.
I am currently using the MuPDF library from here: http://www.mupdf.com/
I've successfully compiled the library and everything is working great, though I am at a loss on how to achieve the following.
I want to attach views, such as button views, textviews, webviews and imageviews to the MuPDFReaderView. But everytime I try to add the view I fail to get any visible results, I can not see the attached view anywhere and I'm sure it's being added because when I debug it, the code is successfully run.
The reason I want to do this is to overlay views on the PDF view which will then scale and move along with the PDF document.
I ofcourse realise there isn't any code in this question, but I can't really post the entire MuPDF source code here, so here's what I think is relevant in a pastebin:
http://pastebin.com/qJFNsvdV
So yeah, how and where would I attach views to the document so they scale and move with the document properly?
We have a similar feature in our Android customizable magazine app, using muPDF: we add views on top on the pdf view to display slide shows or videos inside a magazine page.
This app is open source and available on Github. It should be easy for you to review the code, and see how we implemented this feature.
I am very new to android programming, migrating over from iOS and I am having a hard time.
So, I have set up a new application in Eclipse IDE with a fixed tab and swipe navigation. So it appears to have created a ActionBar. However, I need to change the content of each page rather than it just telling me which tab I clicked.
I have been searching for this for about, 30-45 mins now, and I cannot find anything which makes any sense!
How can I attach a new XML file to a view?
I think the code you are looking for is:
setContentView(R.layout.your_xml_file)
Make sure your xml file is in your res/layout folder in your project
As for your button listener, check this answer.
I don't know very much about Java (I know the basics). I want to create an Image Gallery with Netbeans, but I have absolutely no clue how to do this.
What I want to do:
The User should see all Images inside a specified folder (as thumbs) and should be able to view it in "original size" upon clicking on the Photo. Also (via a Button) he should be able to "transfer" an Image file to that folder.
So basically I have a database of misc. articles, each article has some Images in a unique folder on the Filesystem (eg. /images/art_01), I want to display all images within this folder and have the possibility to add (speaking, copying) new Images into this folder (there is no need to delete an Image) arranged, so it doesn't look too disgusting ;).
Since I just now the basics of Java, I qould appreciate if someone could help me, with something I can adapt directly into a JFrame - if that's possible.
Thanks ;)
With netbeans it's really easy, netbeans has a JFrame/JPanel drag&drop designer/gui builder (right click on package -> new -> JFrame form). After customizing the GUI you can make your main class extend your custom frame, or add a new custom panel to your JFrame, depending on whether you choose to make a JFrame or a JPanel.
http://netbeans.org/kb/docs/java/quickstart-gui.html some details on how to use the netbeans gui builder.
With this builder you can also add events to the different components. If you want to view a directory use JFileChooser.