Some notes I am writing for myself and all the developers who are thinking "There must be a utility for this, Where the !@#$ is it?!".
Some of the classes here are belong to the internal package which will give a "Discouraged Access" warning. You might want to recreate the code for those methods in your class itself. Its better you read this article
Some of the classes here are belong to the internal package which will give a "Discouraged Access" warning. You might want to recreate the code for those methods in your class itself. Its better you read this article
- How to know the current OS on which eclipse is running?
Ans: Use org.eclipse.core.runtime.Platform.getOS() - How do I check if my current OS is Windows (or something else) ?
Ans: Platform.getOS.equals(Platform.OS_WIN32) - How do I log some error in my eclipse plugin?
Ans: Activator.getDefault().getLog().log(new Status(ERROR,Activator.PLUGIN_ID,e1.getMessage()));
- How do I get the current workspace?
Ans: ResourcesPlugin.getWorkspace() - I want to copy contents into a clipboard. Which class gives me clipboard utilities?
Ans: org.eclipse.swt.dnd.Clipboard - I want to add my own UI elements into my plugin How do I do it?
Ans: Use org.eclipse.swt and org.eclipse.jface classes. In short learn SWT and JFace - I want to validate a package name. How the heck do I do it !?
Ans: JavaConventions.validatePackageName(nameOfPackage, JavaCore.VERSION_1_3, JavaCore.VERSION_1_3); - Now I want to validate a package name in a project! How ??
Ans: JavaConventionsUtil.validatePackageName(text, project) - Where can I find the java files related "Open Resource" dialog?
Ans: org.eclipse.ui.ide.jar --> org.eclipse.ui.internal.ide.dialogs.OpenResourceDialog - Who calls OpenResourcesDialog?
Ans: org.eclipse.ui.OpenWorkspaceFile(this is an action) -->org.eclipse.ui.internal.ide.handlers.OpenResourceHandler --> org.eclipse.ui.internal.ide.dialogs.OpenResourceDialog. Go to plugin.xml of org.eclipse.ui.ide --> Extensions subtab --> type in 'Open' in the search field.
The command associated with this dialog is org.eclipse.ui.navigate.openResource - Give me a screenshot of org.eclipse.jdt.debug.ui plugin.
Ans: OKorg.eclipse.jdt.debug.ui - Who implements the Ctrl+1 action?
Ans:
Plugin : org.eclipse.ui.ide_3.8.100.v20120917-171812.jar
CommandID: org.eclipse.jdt.ui.edit.text.java.correction.assist.proposals - Where can I get the ID of the Package Explorer View and other Views?
Ans:See the org.eclipse.jdt.ui.JavaUI class.
No comments:
Post a Comment