[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform] Paths in Plugin

Hello,
I´m new to the plugin development.
Now I have the following problem.

I want to call from an action a CheckedTreeSelectionDialog.
For this I use the following code:


public void run(IAction action) {
		Shell shell = new Shell();
		CheckedTreeSelectionDialog treeDialog = new CheckedTreeSelectionDialog(shell, new TreeLabelProvider(), new TreeContentProvider());
		treeDialog.setInput(ContentProvider.getInitalInput());
		int returnV =treeDialog.open();
		
	}

The TreeLabelProvider has the following constructor:

 // Images for tree nodes
	  private Image file;

	  private Image dir;

	  

	  /**
	   * Constructs a FileTreeLabelProvider
	   */
	  public TreeLabelProvider() {
	    // Create the list to hold the listeners
	    listeners = new ArrayList();

	    // Create the images
	    try {
	    	

	    	
	      file = new Image(null, new FileInputStream("icons/full/obj16/file_obj.gif"));
	      dir = new Image(null, new FileInputStream("icons/full/obj16/fldr_obj.gif"));
	    } catch (FileNotFoundException e) {
	      e.printStackTrace();
	    }
	  }

In this constructor I use relative paths. But with these paths I get a file not found Exception
How can I get the absolute Path at this point in my program code?