public static int registerFrame(EnvironmentFrame frame) {
		Environment env = frame.getEnvironment();
		environmentToFrame.put(env, frame);
		File file = env.getFile();
		if (file != null)
			fileToFrame.put(getPath(file), frame);
		// Adds the listener that changes this object in the event
		// that the file of an environment changes.
		env.addFileChangeListener(FILE_LISTENER);
		// Hide the new dialog box.
		gui.action.NewAction.hideNew();

		return ++numberRegistered;
	}