本文整理汇总了Java中org.eclipse.jdt.core.search.IJavaSearchConstants.WRITE_ACCESSES属性的典型用法代码示例。如果您正苦于以下问题:Java IJavaSearchConstants.WRITE_ACCESSES属性的具体用法?Java IJavaSearchConstants.WRITE_ACCESSES怎么用?Java IJavaSearchConstants.WRITE_ACCESSES使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.jdt.core.search.IJavaSearchConstants
的用法示例。
在下文中一共展示了IJavaSearchConstants.WRITE_ACCESSES属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SelectFieldModeAction
public SelectFieldModeAction(CallHierarchyViewPart v, int mode) {
super(null, AS_RADIO_BUTTON);
if (mode == IJavaSearchConstants.REFERENCES) {
setText(CallHierarchyMessages.SelectFieldModeAction_all_references_label);
setDescription(CallHierarchyMessages.SelectFieldModeAction_all_references_description);
} else if (mode == IJavaSearchConstants.READ_ACCESSES) {
setText(CallHierarchyMessages.SelectFieldModeAction_read_accesses_label);
setDescription(CallHierarchyMessages.SelectFieldModeAction_read_accesses_description);
} else if (mode == IJavaSearchConstants.WRITE_ACCESSES) {
setText(CallHierarchyMessages.SelectFieldModeAction_write_accesses_label);
setDescription(CallHierarchyMessages.SelectFieldModeAction_write_accesses_description);
} else {
Assert.isTrue(false);
}
fView= v;
fMode= mode;
// FIXME(stephan) adjust/create new help context
// PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.CALL_HIERARCHY_TOGGLE_CALL_MODE_ACTION);
}
示例2: initFieldMode
private void initFieldMode() {
int mode;
try {
mode = fDialogSettings.getInt(DIALOGSTORE_FIELD_MODE);
switch (mode) {
case IJavaSearchConstants.REFERENCES:
case IJavaSearchConstants.READ_ACCESSES:
case IJavaSearchConstants.WRITE_ACCESSES:
break; // OK
default:
mode = IJavaSearchConstants.REFERENCES;
}
} catch (NumberFormatException e) {
mode = IJavaSearchConstants.REFERENCES;
}
// force the update
fCurrentFieldMode = -1;
// will fill the main tool bar
setFieldMode(mode);
}
示例3: VariablePattern
public VariablePattern(int patternKind, char[] name, int limitTo, int matchRule) {
super(patternKind, matchRule);
this.fineGrain = limitTo & FINE_GRAIN_MASK;
if (this.fineGrain == 0) {
switch (limitTo & 0xF) {
case IJavaSearchConstants.DECLARATIONS :
this.findDeclarations = true;
break;
case IJavaSearchConstants.REFERENCES :
this.readAccess = true;
this.writeAccess = true;
break;
case IJavaSearchConstants.READ_ACCESSES :
this.readAccess = true;
break;
case IJavaSearchConstants.WRITE_ACCESSES :
this.writeAccess = true;
break;
case IJavaSearchConstants.ALL_OCCURRENCES :
this.findDeclarations = true;
this.readAccess = true;
this.writeAccess = true;
break;
}
this.findReferences = this.readAccess || this.writeAccess;
}
this.name = (this.isCaseSensitive || this.isCamelCase) ? name : CharOperation.toLowerCase(name);
}
示例4: search
public void search(ISearchRequestor requestor, QuerySpecification query,
IProgressMonitor monitor) throws CoreException {
try {
monitor.subTask("Locating GWT matches...");
// Make sure we're searching for Java references
switch (query.getLimitTo()) {
case IJavaSearchConstants.REFERENCES:
case IJavaSearchConstants.ALL_OCCURRENCES:
// These we handle as expected
break;
case IJavaSearchConstants.READ_ACCESSES:
case IJavaSearchConstants.WRITE_ACCESSES:
// We don't actually check field references to see if they're read or
// write accesses; we just treat this as a generic references search
break;
default:
// Anything else (e.g., Declarations), we don't support
return;
}
Set<IIndexedJavaRef> matchingJavaRefs = null;
// Find all matching Java references in the index. The search algorithm
// differs depending on whether we're doing an element query
// (Ctrl-Shift-G) or a pattern query (Java Search dialog box)
if (query instanceof ElementQuerySpecification) {
ElementQuerySpecification elementQuery = (ElementQuerySpecification) query;
matchingJavaRefs = findMatches(elementQuery, true);
} else {
assert (query instanceof PatternQuerySpecification);
PatternQuerySpecification patternQuery = (PatternQuerySpecification) query;
matchingJavaRefs = findMatches(patternQuery);
}
for (IIndexedJavaRef javaRef : matchingJavaRefs) {
Match match = createMatch(javaRef, query);
if (match != null) {
// Report the match location to the Java Search engine
requestor.reportMatch(match);
}
}
} catch (Exception e) {
// If we allow any exceptions to escape, the JDT will disable us
GWTPluginLog.logError("Error finding Java Search matches", e);
}
}
示例5: getLimitTo
@Override
int getLimitTo() {
return IJavaSearchConstants.WRITE_ACCESSES;
}
示例6: makeActions
private void makeActions() {
fRefreshViewAction = new RefreshViewAction(this);
fRefreshSingleElementAction= new RefreshElementAction(fCallHierarchyViewer);
new CallHierarchyOpenEditorHelper(fLocationViewer);
new CallHierarchyOpenEditorHelper(fCallHierarchyViewer);
fOpenLocationAction= new OpenLocationAction(this, getSite());
fLocationCopyAction= fLocationViewer.initCopyAction(getViewSite(), fClipboard);
fFocusOnSelectionAction = new FocusOnSelectionAction(this);
fCopyAction= new CopyCallHierarchyAction(this, fClipboard, fCallHierarchyViewer);
fSearchScopeActions = new SearchScopeActionGroup(this, fDialogSettings);
fShowSearchInDialogAction= new ShowSearchInDialogAction(this, fCallHierarchyViewer);
fFiltersActionGroup = new CallHierarchyFiltersActionGroup(this,
fCallHierarchyViewer);
fHistoryDropDownAction = new HistoryDropDownAction(this);
fHistoryDropDownAction.setEnabled(false);
fCancelSearchAction = new CancelSearchAction(this);
setCancelEnabled(false);
fExpandWithConstructorsAction= new ExpandWithConstructorsAction(this, fCallHierarchyViewer);
fRemoveFromViewAction= new RemoveFromViewAction(this, fCallHierarchyViewer);
fPinViewAction= new PinCallHierarchyViewAction(this);
fToggleOrientationActions = new ToggleOrientationAction[] {
new ToggleOrientationAction(this, VIEW_ORIENTATION_VERTICAL),
new ToggleOrientationAction(this, VIEW_ORIENTATION_HORIZONTAL),
new ToggleOrientationAction(this, VIEW_ORIENTATION_AUTOMATIC),
new ToggleOrientationAction(this, VIEW_ORIENTATION_SINGLE)
};
fRemoveFromViewAction.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_DELETE);
fToggleCallModeActions = new ToggleCallModeAction[] {
new ToggleCallModeAction(this, CALL_MODE_CALLERS),
new ToggleCallModeAction(this, CALL_MODE_CALLEES)
};
fToggleFieldModeActions = new SelectFieldModeAction[] {
new SelectFieldModeAction(this, IJavaSearchConstants.REFERENCES),
new SelectFieldModeAction(this, IJavaSearchConstants.READ_ACCESSES),
new SelectFieldModeAction(this, IJavaSearchConstants.WRITE_ACCESSES)
};
fActionGroups = new CompositeActionGroup(new ActionGroup[] {
new OpenEditorActionGroup(this),
new OpenViewActionGroup(this),
new CCPActionGroup(this, true),
new GenerateActionGroup(this),
new RefactorActionGroup(this),
new JavaSearchActionGroup(this),
fSearchScopeActions, fFiltersActionGroup
});
}
示例7: computeContentDescription
/**
* Computes the content description for the call hierarchy computation.
*
* @param includeMask the include mask
* @return the content description
* @since 3.7
*/
private String computeContentDescription(int includeMask) {
// see also HistoryAction.getElementLabel(IMember[])
String scopeDescription= fSearchScopeActions.getFullDescription(includeMask);
if (fInputElements.length == 1) {
IMember element= fInputElements[0];
String elementName= JavaElementLabels.getElementLabel(element, JavaElementLabels.ALL_DEFAULT);
String[] args= new String[] { elementName, scopeDescription };
if (fCurrentCallMode == CALL_MODE_CALLERS) {
switch (element.getElementType()) {
case IJavaElement.TYPE:
return Messages.format(CallHierarchyMessages.CallHierarchyViewPart_callsToConstructors, args);
case IJavaElement.FIELD:
switch (this.fCurrentFieldMode) {
case IJavaSearchConstants.READ_ACCESSES:
return Messages.format(CallHierarchyMessages.CallHierarchyViewPart_callsToFieldRead, args);
case IJavaSearchConstants.WRITE_ACCESSES:
return Messages.format(CallHierarchyMessages.CallHierarchyViewPart_callsToFieldWrite, args);
default: // all references
return Messages.format(CallHierarchyMessages.CallHierarchyViewPart_callsToField, args);
}
case IJavaElement.METHOD:
case IJavaElement.INITIALIZER:
default:
return Messages.format(CallHierarchyMessages.CallHierarchyViewPart_callsToMethod, args);
}
} else {
switch (element.getElementType()) {
case IJavaElement.TYPE:
return Messages.format(CallHierarchyMessages.CallHierarchyViewPart_callsFromConstructors, args);
case IJavaElement.FIELD:
case IJavaElement.METHOD:
case IJavaElement.INITIALIZER:
default:
return Messages.format(CallHierarchyMessages.CallHierarchyViewPart_callsFromMethod, args);
}
}
} else {
if (fCurrentCallMode == CALL_MODE_CALLERS) {
switch (fInputElements.length) {
case 0:
Assert.isTrue(false);
return null;
case 2:
return Messages.format(CallHierarchyMessages.CallHierarchyViewPart_callsToMembers_2,
new String[] { getShortLabel(fInputElements[0]), getShortLabel(fInputElements[1]), scopeDescription });
default:
return Messages.format(CallHierarchyMessages.CallHierarchyViewPart_callsToMembers_more,
new String[] { getShortLabel(fInputElements[0]), getShortLabel(fInputElements[1]), scopeDescription });
}
} else {
switch (fInputElements.length) {
case 0:
Assert.isTrue(false);
return null;
case 2:
return Messages.format(CallHierarchyMessages.CallHierarchyViewPart_callsFromMembers_2,
new String[] { getShortLabel(fInputElements[0]), getShortLabel(fInputElements[1]), scopeDescription });
default:
return Messages.format(CallHierarchyMessages.CallHierarchyViewPart_callsFromMembers_more,
new String[] { getShortLabel(fInputElements[0]), getShortLabel(fInputElements[1]), scopeDescription });
}
}
}
}