/** * Checks if it is possible to rename the element to the specified name, * and throws an exception if the rename is not possible. Does not actually modify anything. * * @param name the new name to check the renaming possibility for. * @throws IncorrectOperationException if the rename is not supported or not possible for some reason. */ @Override public void checkSetName(String name) throws IncorrectOperationException { throw new IncorrectOperationException(CAN_NOT_MODIFY_MESSAGE); }
public static boolean isSmallIde(){ return !PlatformUtils.isIntelliJ(); } }
@Nullable protected GoExpression getExpression(@NotNull PsiElement[] elements) { return ObjectUtils.tryCast(ArrayUtil.getFirstElement(elements), GoExpression.class); } }
@Override protected void selectTargets(List<PsiElement> targets, @NotNull Consumer<List<PsiElement>> selectionConsumer) { selectionConsumer.consume(targets); }
public void processFiles(@NotNull Processor<FileData> processor) { for (FileData fileData : myFilesData.values()) { if (!processor.process(fileData)) { return; } } }
@Nullable private static GoReferenceExpression unwrapParensAndCast(@Nullable PsiElement e) { while (e instanceof GoParenthesesExpr) { e = ((GoParenthesesExpr)e).getExpression(); } return ObjectUtils.tryCast(e, GoReferenceExpression.class); }
@NotNull private String getPresentableName() { return ObjectUtils.notNull(myPresentableName, "go"); } }
@NotNull public static String getBinaryFileNameForPath(@NotNull String path) { String resultBinaryName = FileUtil.getNameWithoutExtension(PathUtil.getFileName(path)); return SystemInfo.isWindows ? resultBinaryName + ".exe" : resultBinaryName; }
@NotNull @Override public GoExpression[] getActualParameters(@NotNull GoArgumentList o) { return ArrayUtil.toObjectArray(o.getExpressionList(), GoExpression.class); }
private RecursiveMethodCallMarkerInfo(@NotNull PsiElement methodCall) { super(methodCall, methodCall.getTextRange(), AllIcons.Gutter.RecursiveMethod, Pass.UPDATE_OVERRIDDEN_MARKERS, FunctionUtil.constant("Recursive call"), null, GutterIconRenderer.Alignment.RIGHT ); } }
/** * @return unmodifiable map of the parent environment, that will be passed to the process if isPassParentEnvironment() == true */ @NotNull public Map<String, String> getParentEnvironment() { return PlatformUtils.isAppCode() ? System.getenv() // Temporarily fix for OC-8606 : EnvironmentUtil.getEnvironmentMap(); }
@Override public int hashCode() { int result = os.hashCode(); result = 31 * result + arch.hashCode(); result = 31 * result + cgo.hashCode(); result = 31 * result + compiler.hashCode(); result = 31 * result + goVersion.hashCode(); result = 31 * result + Arrays.hashCode(customFlags); return result; } }
@Override public boolean process(T s) { ProgressManager.checkCanceled(); return super.process(s); } }
@Override protected void selectTargets(List<PsiElement> targets, @NotNull Consumer<List<PsiElement>> selectionConsumer) { selectionConsumer.consume(targets); }
@NotNull @Override public Shortcut[] getShortcut() { throw new IncorrectOperationException("see getActionIdForShortcut()"); }
public void processFile(@NotNull String filePath, @NotNull Processor<RangeData> processor) { FileData fileData = myFilesData.get(filePath); if (fileData != null) { for (RangeData rangeData : fileData.myRangesData.values()) { if (!processor.process(rangeData)) { return; } } } }
@Override protected void doUnwrap(PsiElement element, Context context) throws IncorrectOperationException { PsiElement parent = element.getParent(); GoCallExpr call = parent != null ? ObjectUtils.tryCast(parent.getParent(), GoCallExpr.class) : null; if (call != null) { context.extractElement(element, call); context.delete(call); } }
@NotNull private String getPresentableName() { return ObjectUtils.notNull(myPresentableName, "Ballerina Executor"); } }
public GoInplaceVariableIntroducer(GoIntroduceOperation operation) { super(operation.getVar(), operation.getEditor(), operation.getProject(), "Introduce Variable", ArrayUtil.toObjectArray(operation.getOccurrences(), PsiElement.class), null); } }
/** * Processes the user pressing the Insert key while in INSERT or REPLACE mode. This simply toggles the * Insert/Overwrite state which updates the status bar. * * @param editor The editor to toggle the state in */ public void processInsert(Editor editor) { final EditorEx editorEx = ObjectUtils.tryCast(editor, EditorEx.class); if (editorEx == null) return; editorEx.setInsertMode(!editorEx.isInsertMode()); CommandState.getInstance(editor).toggleInsertOverwrite(); }