mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Find tool window: split 'show preview' setting to two for find/replace
This commit is contained in:
@@ -378,6 +378,7 @@ public class FindInProjectUtil {
|
||||
presentation.setSearchPattern(null);
|
||||
presentation.setReplacePattern(null);
|
||||
}
|
||||
presentation.setReplaceMode(findModel.isReplaceState());
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -50,6 +50,7 @@ public class UsageViewPresentation {
|
||||
private boolean myExcludeAvailable = true;
|
||||
private Pattern mySearchPattern;
|
||||
private Pattern myReplacePattern;
|
||||
private boolean myReplaceMode;
|
||||
|
||||
public String getTabText() {
|
||||
return myTabText;
|
||||
@@ -234,6 +235,14 @@ public class UsageViewPresentation {
|
||||
return myReplacePattern;
|
||||
}
|
||||
|
||||
public boolean isReplaceMode() {
|
||||
return myReplaceMode;
|
||||
}
|
||||
|
||||
public void setReplaceMode(boolean replaceMode) {
|
||||
myReplaceMode = replaceMode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
|
||||
@@ -72,7 +72,10 @@ open class UsageViewSettings(
|
||||
var isShowModules by property(false)
|
||||
|
||||
@get:OptionTag("IS_PREVIEW_USAGES")
|
||||
var isPreviewUsages by property(true)
|
||||
var isPreviewUsages by property(false)
|
||||
|
||||
@get:OptionTag("IS_REPLACE_PREVIEW_USAGES")
|
||||
var isReplacePreviewUsages by property(true)
|
||||
|
||||
@get:OptionTag("IS_SORT_MEMBERS_ALPHABETICALLY")
|
||||
var isSortAlphabetically by property(false)
|
||||
|
||||
@@ -19,11 +19,11 @@ class PreviewUsageAction extends RuleAction {
|
||||
|
||||
@Override
|
||||
protected boolean getOptionValue() {
|
||||
return myView.getUsageViewSettings().isPreviewUsages();
|
||||
return myView.isPreviewUsages();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setOptionValue(final boolean value) {
|
||||
myView.getUsageViewSettings().setPreviewUsages(value);
|
||||
protected void setOptionValue(boolean value) {
|
||||
myView.setPreviewUsages(value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -520,7 +520,7 @@ public class UsageViewImpl implements UsageView {
|
||||
|
||||
myCentralPanel.add(myPreviewSplitter, BorderLayout.CENTER);
|
||||
|
||||
if (getUsageViewSettings().isPreviewUsages()) {
|
||||
if (isPreviewUsages()) {
|
||||
myPreviewSplitter.setProportion(getUsageViewSettings().getPreviewUsagesSplitterProportion());
|
||||
treePane.putClientProperty(UIUtil.KEEP_BORDER_SIDES, SideBorder.RIGHT);
|
||||
final JBTabbedPane tabbedPane = new JBTabbedPane(SwingConstants.BOTTOM){
|
||||
@@ -585,6 +585,18 @@ public class UsageViewImpl implements UsageView {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isPreviewUsages() {
|
||||
return myPresentation.isReplaceMode() ? getUsageViewSettings().isReplacePreviewUsages() : getUsageViewSettings().isPreviewUsages();
|
||||
}
|
||||
|
||||
public void setPreviewUsages(boolean state) {
|
||||
if (myPresentation.isReplaceMode()) {
|
||||
getUsageViewSettings().setReplacePreviewUsages(state);
|
||||
} else {
|
||||
getUsageViewSettings().setPreviewUsages(state);
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static UsageFilteringRule[] getActiveFilteringRules(final Project project) {
|
||||
final UsageFilteringRuleProvider[] providers = Extensions.getExtensions(UsageFilteringRuleProvider.EP_NAME);
|
||||
|
||||
Reference in New Issue
Block a user