mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-30 19:52:13 +01:00
Indent pass, no code change
This commit is contained in:
parent
858bd455d7
commit
78e098e3d7
@ -82,8 +82,8 @@ public class FindReplace extends JFrame implements ActionListener {
|
||||
replaceField = new JTextField(20);
|
||||
|
||||
// Fill the findString with selected text if no previous value
|
||||
if (editor.getSelectedText() != null &&
|
||||
editor.getSelectedText().length() > 0)
|
||||
if (editor.getSelectedText() != null
|
||||
&& editor.getSelectedText().length() > 0)
|
||||
findString = editor.getSelectedText();
|
||||
|
||||
if (findString != null)
|
||||
@ -136,6 +136,7 @@ public class FindReplace extends JFrame implements ActionListener {
|
||||
|
||||
JPanel buttonPanel = new JPanel();
|
||||
buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.LINE_AXIS));
|
||||
|
||||
// ordering of buttons is different on mac versus pc
|
||||
if (OSUtils.isMacOS()) {
|
||||
buttonPanel.add(replaceAllButton);
|
||||
@ -151,7 +152,8 @@ public class FindReplace extends JFrame implements ActionListener {
|
||||
} else {
|
||||
buttonPanel.add(findButton);
|
||||
buttonPanel.add(Box.createRigidArea(new Dimension(8, 0)));
|
||||
buttonPanel.add(previousButton); // is this the right position for non-Mac?
|
||||
buttonPanel.add(previousButton); // is this the right position for
|
||||
// non-Mac?
|
||||
buttonPanel.add(Box.createRigidArea(new Dimension(8, 0)));
|
||||
buttonPanel.add(replaceFindButton);
|
||||
buttonPanel.add(Box.createRigidArea(new Dimension(8, 0)));
|
||||
@ -240,7 +242,6 @@ public class FindReplace extends JFrame implements ActionListener {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void handleClose() {
|
||||
// System.out.println("handling close now");
|
||||
findString = findField.getText();
|
||||
@ -250,7 +251,6 @@ public class FindReplace extends JFrame implements ActionListener {
|
||||
setVisible(false);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
public void show() {
|
||||
findField.requestFocusInWindow();
|
||||
@ -281,17 +281,18 @@ public class FindReplace extends JFrame implements ActionListener {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// look for the next instance of the find string to be found
|
||||
// once found, select it (and go to that line)
|
||||
|
||||
private boolean find(boolean wrap,boolean backwards,boolean searchTabs,int originTab) {
|
||||
private boolean find(boolean wrap, boolean backwards, boolean searchTabs,
|
||||
int originTab) {
|
||||
// System.out.println("Find: " + originTab);
|
||||
boolean wrapNeeded = false;
|
||||
String search = findField.getText();
|
||||
// System.out.println("finding for " + search + " " + findString);
|
||||
// this will catch "find next" being called when no search yet
|
||||
if (search.length() == 0) return false;
|
||||
if (search.length() == 0)
|
||||
return false;
|
||||
|
||||
String text = editor.getText();
|
||||
|
||||
@ -338,8 +339,8 @@ public class FindReplace extends JFrame implements ActionListener {
|
||||
originTab = realCurrentTab;
|
||||
|
||||
if (!wrap)
|
||||
if ((!backwards && realCurrentTab + 1 >= sketch.getCodeCount()) ||
|
||||
(backwards && realCurrentTab - 1 < 0))
|
||||
if ((!backwards && realCurrentTab + 1 >= sketch.getCodeCount())
|
||||
|| (backwards && realCurrentTab - 1 < 0))
|
||||
return false; // Can't continue without wrap
|
||||
|
||||
if (backwards) {
|
||||
@ -359,7 +360,8 @@ public class FindReplace extends JFrame implements ActionListener {
|
||||
}
|
||||
|
||||
if (wrapNeeded)
|
||||
nextIndex = backwards ? text.lastIndexOf(search) : text.indexOf(search, 0);
|
||||
nextIndex = backwards ? text.lastIndexOf(search) : text.indexOf(search,
|
||||
0);
|
||||
}
|
||||
|
||||
if (nextIndex != -1) {
|
||||
@ -370,10 +372,9 @@ public class FindReplace extends JFrame implements ActionListener {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Replace the current selection with whatever's in the
|
||||
* replacement text field.
|
||||
* Replace the current selection with whatever's in the replacement text
|
||||
* field.
|
||||
*/
|
||||
public void replace() {
|
||||
if (findField.getText().length() == 0)
|
||||
@ -399,8 +400,8 @@ public class FindReplace extends JFrame implements ActionListener {
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace the current selection with whatever's in the
|
||||
* replacement text field, and then find the next match
|
||||
* Replace the current selection with whatever's in the replacement text
|
||||
* field, and then find the next match
|
||||
*/
|
||||
public void replaceAndFindNext() {
|
||||
replace();
|
||||
@ -408,8 +409,8 @@ public class FindReplace extends JFrame implements ActionListener {
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace everything that matches by doing find and replace
|
||||
* alternately until nothing more found.
|
||||
* Replace everything that matches by doing find and replace alternately until
|
||||
* nothing more found.
|
||||
*/
|
||||
public void replaceAll() {
|
||||
if (findField.getText().length() == 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user