public void install(JTextComponent tc) {

			boolean replaceTabs = false;
			if (tc instanceof RSyntaxTextArea) {
				RSyntaxTextArea textArea = (RSyntaxTextArea)tc;
				markOccurrencesEnabled = textArea.getMarkOccurrences();
				textArea.setMarkOccurrences(false);
				replaceTabs = textArea.getTabsEmulated();
			}

			Highlighter h = tc.getHighlighter();

			try {

				// Insert the parameter text
				ParameterizedCompletionInsertionInfo info =
					pc.getInsertionInfo(tc, replaceTabs);
				tc.replaceSelection(info.getTextToInsert());

				// Add highlights around the parameters.
				final int replacementCount = info.getReplacementCount();
				for (int i=0; i<replacementCount; i++) {
					DocumentRange dr = info.getReplacementLocation(i);
					HighlightPainter painter = i<replacementCount-1 ? p : endingP;
					 // "-1" is a workaround for Java Highlight issues.
					tags.add(h.addHighlight(
							dr.getStartOffset()-1, dr.getEndOffset(), painter));
				}
				for (int i=0; i<info.getReplacementCopyCount(); i++) {
					ReplacementCopy rc = info.getReplacementCopy(i);
					paramCopyInfos.add(new ParamCopyInfo(rc.getId(),
						(Highlight)h.addHighlight(rc.getStart(), rc.getEnd(),
								paramCopyP)));
				}

				// Go back and start at the first parameter.
				tc.setCaretPosition(info.getSelectionStart());
				if (info.hasSelection()) {
					tc.moveCaretPosition(info.getSelectionEnd());
				}

				minPos = info.getMinOffset();
				maxPos = info.getMaxOffset();
				try {
					Document doc = tc.getDocument();
					if (maxPos.getOffset()==0) {
						// Positions at offset 0 don't track document changes,
						// so we must manually do this here.  This is not a
						// common occurrence.
						maxPos = doc.createPosition(
								info.getTextToInsert().length());
					}
					defaultEndOffs = doc.createPosition(
							info.getDefaultEndOffs());
				} catch (BadLocationException ble) {
					ble.printStackTrace(); // Never happens
				}

				// Listen for document events AFTER we insert
				tc.getDocument().addDocumentListener(this);

			} catch (BadLocationException ble) {
				ble.printStackTrace(); // Never happens
			}

			// Add listeners to the text component, AFTER text insertion.
			tc.addCaretListener(this);
			tc.addFocusListener(this);
			installKeyBindings();

		}