private static void openFile(String filepath) {
		if ((filepath != null) && (!filepath.equals("")) && (!filepath.equals("%1"))) {
			try {
				// ensure that we have a full pathname [srk]
				filepath = new File(filepath).getCanonicalPath();

				// grab the file's extension
				String extension = filepath.substring(filepath.lastIndexOf(".") + 1, filepath.length());

				// use the extension to figure out the file's format
				String fileFormat = Outliner.fileFormatManager.getOpenFileFormatNameForExtension(extension);

				// crank up a fresh docInfo struct
				DocumentInfo docInfo = new DocumentInfo();
				PropertyContainerUtil.setPropertyAsString(docInfo, DocumentInfo.KEY_PATH, filepath);
				PropertyContainerUtil.setPropertyAsString(docInfo, DocumentInfo.KEY_ENCODING_TYPE,
						Preferences.getPreferenceString(Preferences.OPEN_ENCODING).cur);
				PropertyContainerUtil.setPropertyAsString(docInfo, DocumentInfo.KEY_FILE_FORMAT, fileFormat);

				// try to open up the file
				FileMenu.openFile(docInfo, fileProtocolManager.getDefault());
			} catch (IOException e) {
				System.out.println("IOException: " + e.getMessage());
			}
		} else {
			// Create a Document. This must come after visiblity otherwise
			// the window won't be activated.
			if (Preferences.getPreferenceBoolean(Preferences.NEW_DOC_ON_STARTUP).cur) {
				OutlinerDocument doc = new OutlinerDocument("");
				Outliner.menuBar.windowMenu.changeToWindow(doc);
			}
		}
	}