/** * 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; }
/** * 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 new Java element hyperlink detector. * * @param editor * the editor in which to detect the hyperlink */ public PointcutElementHyperlinkDetector(ITextEditor editor) { Assert.isNotNull(editor); fTextEditor = editor; }
public MakeTypeGlobalChange(XSDTypeDefinition component, String newName) { Assert.isNotNull(newName, "new name"); //$NON-NLS-1$ fTypeComponent = component; fNewName = newName; }
/** * 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; }
/** * Asserts that the given object is not <code>null</code>. If this * is not the case, some kind of unchecked exception is thrown. * <p> * As a general rule, parameters passed to API methods must not be * <code>null</code> unless <b>explicitly</b> allowed in the method's * specification. Similarly, results returned from API methods are never * <code>null</code> unless <b>explicitly</b> allowed in the method's * specification. Implementations are encouraged to make regular use of * <code>Assert.isNotNull</code> to ensure that <code>null</code> * parameters are detected as early as possible. * </p> * * @param object the value to test * @exception RuntimeException an unspecified unchecked exception if the object * is <code>null</code> */ public static void isNotNull(Object object) { // succeed as quickly as possible if (object != null) { return; } isNotNull(object, "");//$NON-NLS-1$ }
/** * Asserts that the given object is not <code>null</code>. If this * is not the case, some kind of unchecked exception is thrown. * <p> * As a general rule, parameters passed to API methods must not be * <code>null</code> unless <b>explicitly</b> allowed in the method's * specification. Similarly, results returned from API methods are never * <code>null</code> unless <b>explicitly</b> allowed in the method's * specification. Implementations are encouraged to make regular use of * <code>Assert.isNotNull</code> to ensure that <code>null</code> * parameters are detected as early as possible. * </p> * * @param object the value to test * @exception RuntimeException an unspecified unchecked exception if the object * is <code>null</code> */ public static void isNotNull(Object object) { // succeed as quickly as possible if (object != null) { return; } isNotNull(object, "");//$NON-NLS-1$ }
/** * Creates a new instance. * * @param chars the chars to match. */ public CharacterMatch(char[] chars) { Assert.isNotNull(chars); Assert.isTrue(chars.length > 0); _chars = chars; Arrays.sort(chars); }
/** * Registers the given presentation damager for a particular content type. * If there is already a damager registered for this type, the old damager * is removed first. * * @param damager the presentation damager to register, or <code>null</code> to remove an existing one * @param contentType the content type under which to register */ public void setDamager(IPresentationDamager damager, String contentType) { Assert.isNotNull(contentType); if (fDamagers == null) fDamagers= new HashMap(); if (damager == null) fDamagers.remove(contentType); else fDamagers.put(contentType, damager); }
/** * Registers the given presentation repairer for a particular content type. * If there is already a repairer registered for this type, the old repairer * is removed first. * * @param repairer the presentation repairer to register, or <code>null</code> to remove an existing one * @param contentType the content type under which to register */ public void setRepairer(IPresentationRepairer repairer, String contentType) { Assert.isNotNull(contentType); if (fRepairers == null) fRepairers= new HashMap(); if (repairer == null) fRepairers.remove(contentType); else fRepairers.put(contentType, repairer); }
/** * Creates a new resettable scanner that will forward calls * to <code>scanner</code>, but store a marked position. * * @param scanner the delegate scanner */ public ResettableScanner(final ICharacterScanner scanner) { Assert.isNotNull(scanner); fDelegate= scanner; mark(); }
public AspectJEditorTitleImageUpdater(AspectJEditor editor) { Assert.isNotNull(editor); this.editor = editor; problemsDecorator = new ProblemsLabelDecorator(registry); }
/** * Creates a damager/repairer that uses the given scanner. The scanner may not be <code>null</code> * and is assumed to return only token that carry text attributes. * * @param scanner the token scanner to be used, may not be <code>null</code> */ public DefaultDamagerRepairer(ITokenScanner scanner) { Assert.isNotNull(scanner); fScanner= scanner; fDefaultTextAttribute= new TextAttribute(null,null); }
/** * 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; }
protected void setSourceViewerConfiguration( SourceViewerConfiguration configuration) { Assert.isNotNull(configuration); SourceViewerConfiguration myConf = this.getSourceViewerConfiguration(); if ((myConf != null) && (myConf instanceof AJSourceViewerConfiguration) && !(configuration instanceof AJSourceViewerConfiguration)) return; super.setSourceViewerConfiguration(configuration); }
public void install(ITextViewer viewer) { Assert.isNotNull(viewer); fViewer= viewer; fViewer.addTextInputListener(fInternalListener); IDocument document= viewer.getDocument(); if (document != null) fInternalListener.inputDocumentChanged(null, document); }
String additionalProposalInfo, int relevance, IAction postAction) Assert.isNotNull(replacementString); Assert.isTrue(replacementOffset >= 0); Assert.isTrue(replacementLength >= 0);