/** * Sets the document partitioning for this presentation reconciler. * * @param partitioning the document partitioning for this presentation reconciler. * @since 3.0 */ public void setDocumentPartitioning(String partitioning) { Assert.isNotNull(partitioning); fPartitioning= partitioning; }
/** * Asserts that an argument is legal. If the given boolean is * not <code>true</code>, an <code>IllegalArgumentException</code> * is thrown. * * @param expression the outcome of the check * @return <code>true</code> if the check passes (does not return * if the check fails) * @exception IllegalArgumentException if the legality test failed */ public static boolean isLegal(boolean expression) { // succeed as quickly as possible if (expression) { return true; } return isLegal(expression, "");//$NON-NLS-1$ }
/** * Asserts that the given boolean is <code>true</code>. If this * is not the case, some kind of unchecked exception is thrown. * * @param expression the outcome of the check * @return <code>true</code> if the check passes (does not return * if the check fails) */ public static boolean isTrue(boolean expression) { // succeed as quickly as possible if (expression) { return true; } return isTrue(expression, "");//$NON-NLS-1$ }
/** * Asserts that the given boolean is <code>true</code>. If this * is not the case, some kind of unchecked exception is thrown. * * @param expression the outcome of the check * @return <code>true</code> if the check passes (does not return * if the check fails) */ public static boolean isTrue(boolean expression) { // succeed as quickly as possible if (expression) { return true; } return isTrue(expression, "");//$NON-NLS-1$ }
/** * Creates a new Java element hyperlink detector. * * @param editor * the editor in which to detect the hyperlink */ public PointcutElementHyperlinkDetector(ITextEditor editor) { Assert.isNotNull(editor); fTextEditor = editor; }
/** * Creates a new completion proposal. All fields are initialized based on the provided information. * * @param replacementString the actual string to be inserted into the document * @param replacementPosition the position of the text to be replaced * @param cursorPosition the position of the cursor following the insert relative to replacementOffset * @param image the image to display for this proposal * @param displayString the string to be displayed for the proposal * @param contextInformation the context information associated with this proposal * @param additionalProposalInfo the additional information associated with this proposal */ public PositionBasedCompletionProposal(String replacementString, Position replacementPosition, int cursorPosition, Image image, String displayString, IContextInformation contextInformation, String additionalProposalInfo) { Assert.isNotNull(replacementString); Assert.isTrue(replacementPosition != null); fReplacementString= replacementString; fReplacementPosition= replacementPosition; fCursorPosition= cursorPosition; fImage= image; fDisplayString= displayString; fContextInformation= contextInformation; fAdditionalProposalInfo= additionalProposalInfo; }
/** * Checks whether <code>position</code> resides in a default (SQL) partition of <code>_document</code>. * * @param position the position to be checked * @return <code>true</code> if <code>position</code> is in the default partition of <code>_document</code>, * <code>false</code> otherwise */ public boolean isDefaultPartition(int position) { Assert.isTrue(position >= 0); Assert.isTrue(position <= _document.getLength()); try { ITypedRegion region = TextUtilities.getPartition(_document, _partitioning, position, false); return region.getType().equals(_partition); } catch (BadLocationException e) { // _log.debug(EditorMessages.error_badLocationException, e); } return false; }
/** * Asserts that an argument is legal. If the given boolean is * not <code>true</code>, an <code>IllegalArgumentException</code> * is thrown. * * @param expression the outcome of the check * @return <code>true</code> if the check passes (does not return * if the check fails) * @exception IllegalArgumentException if the legality test failed */ public static boolean isLegal(boolean expression) { // succeed as quickly as possible if (expression) { return true; } return isLegal(expression, "");//$NON-NLS-1$ }
public MakeTypeGlobalChange(XSDTypeDefinition component, String newName) { Assert.isNotNull(newName, "new name"); //$NON-NLS-1$ fTypeComponent = component; fNewName = newName; }
/** * Creates a new instance. * * @param document the document to scan * @param partitioning the partitioning to use for scanning * @param partition the partition to scan in */ public SQLHeuristicScanner(IDocument document, String partitioning, String partition) { Assert.isNotNull(document); Assert.isNotNull(partitioning); Assert.isNotNull(partition); _document = document; _partitioning = partitioning; _partition = partition; }
/** * Creates a damager/repairer that uses the given scanner and returns the given default * text attribute if the current token does not carry a text attribute. * * @param scanner the token scanner to be used * @param defaultTextAttribute the text attribute to be returned if non is specified by the current token, * may not be <code>null</code> * * @deprecated use DefaultDamagerRepairer(ITokenScanner) instead */ public DefaultDamagerRepairer(ITokenScanner scanner, TextAttribute defaultTextAttribute) { Assert.isNotNull(defaultTextAttribute); fScanner= scanner; fDefaultTextAttribute= defaultTextAttribute; }
/** * Creates a new instance. * * @param document the document to scan * @param scanner the {@link SQLHeuristicScanner}to be used for scanning the document. It must be installed on the * same <code>IDocument</code>. */ public SQLIndenter(IDocument document, SQLHeuristicScanner scanner) { Assert.isNotNull(document); Assert.isNotNull(scanner); _document = document; _scanner = scanner; }
/** * Creates a template proposal with a template and its context. * * @param template the template * @param context the context in which the template was requested. * @param image the icon of the proposal. * @param region the region this proposal is applied to * @param relevance the relevance of the proposal */ public SQLTemplateProposal(SQLEditor editor, Template template, TemplateContext context, IRegion region, Image image, int relevance) { Assert.isNotNull(template); Assert.isNotNull(context); Assert.isNotNull(region); _template = template; _context = context; _image = image; _region = region; _displayString = null; _relevance = relevance; _editor = editor; }
Assert.isTrue((increments.length() != 0 || decrements.length() != 0) && !increments.equals(decrements));