mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 06:05:01 +07:00
create property:both getter nad setter from usage (IDEA-73186); return cursor to the initial state
This commit is contained in:
+1
@@ -1,6 +1,7 @@
|
||||
// "Create Getter" "true"
|
||||
public class Test {
|
||||
Integer field;
|
||||
|
||||
public foo() {
|
||||
getField();
|
||||
}
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
// "Create Property" "true"
|
||||
class Calculator {
|
||||
int i;
|
||||
|
||||
public void printError() {
|
||||
setI(0);
|
||||
}
|
||||
|
||||
public void setI(int i) {
|
||||
this.i = i;
|
||||
}
|
||||
|
||||
public int getI() {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
// "Create Property" "true"
|
||||
class Calculator {
|
||||
private int i;
|
||||
|
||||
public void printError() {
|
||||
setI(0);
|
||||
}
|
||||
|
||||
public void setI(int i) {
|
||||
this.i = i;
|
||||
}
|
||||
|
||||
public int getI() {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Create Property" "false"
|
||||
class Calculator {
|
||||
int i;
|
||||
public void printError() {
|
||||
set<caret>I(0);
|
||||
}
|
||||
public int getI() {return i;}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// "Create Property" "true"
|
||||
class Calculator {
|
||||
int i;
|
||||
public void printError() {
|
||||
set<caret>I(0);
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Create Property" "true"
|
||||
class Calculator {
|
||||
public void printError() {
|
||||
set<caret>I(0);
|
||||
}
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.codeInsight.daemon.quickFix;
|
||||
|
||||
public class CreatePropertyFromUsageTest extends LightQuickFix15TestCase {
|
||||
public void test() throws Exception { doAllTests(); }
|
||||
|
||||
@Override
|
||||
protected String getBasePath() {
|
||||
return "/codeInsight/daemonCodeAnalyzer/quickFix/createPropertyFromUsage";
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user