1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-02-07 01:54:26 +01:00

Indent pass, no code change

This commit is contained in:
Cristian Maglie 2015-01-07 16:01:37 +01:00
parent 858bd455d7
commit 78e098e3d7

View File

@ -82,8 +82,8 @@ public class FindReplace extends JFrame implements ActionListener {
replaceField = new JTextField(20); replaceField = new JTextField(20);
// Fill the findString with selected text if no previous value // Fill the findString with selected text if no previous value
if (editor.getSelectedText() != null && if (editor.getSelectedText() != null
editor.getSelectedText().length() > 0) && editor.getSelectedText().length() > 0)
findString = editor.getSelectedText(); findString = editor.getSelectedText();
if (findString != null) if (findString != null)
@ -136,6 +136,7 @@ public class FindReplace extends JFrame implements ActionListener {
JPanel buttonPanel = new JPanel(); JPanel buttonPanel = new JPanel();
buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.LINE_AXIS)); buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.LINE_AXIS));
// ordering of buttons is different on mac versus pc // ordering of buttons is different on mac versus pc
if (OSUtils.isMacOS()) { if (OSUtils.isMacOS()) {
buttonPanel.add(replaceAllButton); buttonPanel.add(replaceAllButton);
@ -151,7 +152,8 @@ public class FindReplace extends JFrame implements ActionListener {
} else { } else {
buttonPanel.add(findButton); buttonPanel.add(findButton);
buttonPanel.add(Box.createRigidArea(new Dimension(8, 0))); 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(Box.createRigidArea(new Dimension(8, 0)));
buttonPanel.add(replaceFindButton); buttonPanel.add(replaceFindButton);
buttonPanel.add(Box.createRigidArea(new Dimension(8, 0))); buttonPanel.add(Box.createRigidArea(new Dimension(8, 0)));
@ -240,7 +242,6 @@ public class FindReplace extends JFrame implements ActionListener {
}); });
} }
public void handleClose() { public void handleClose() {
// System.out.println("handling close now"); // System.out.println("handling close now");
findString = findField.getText(); findString = findField.getText();
@ -250,7 +251,6 @@ public class FindReplace extends JFrame implements ActionListener {
setVisible(false); setVisible(false);
} }
/* /*
public void show() { public void show() {
findField.requestFocusInWindow(); 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 // look for the next instance of the find string to be found
// once found, select it (and go to that line) // 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); // System.out.println("Find: " + originTab);
boolean wrapNeeded = false; boolean wrapNeeded = false;
String search = findField.getText(); String search = findField.getText();
// System.out.println("finding for " + search + " " + findString); // System.out.println("finding for " + search + " " + findString);
// this will catch "find next" being called when no search yet // 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(); String text = editor.getText();
@ -338,8 +339,8 @@ public class FindReplace extends JFrame implements ActionListener {
originTab = realCurrentTab; originTab = realCurrentTab;
if (!wrap) if (!wrap)
if ((!backwards && realCurrentTab + 1 >= sketch.getCodeCount()) || if ((!backwards && realCurrentTab + 1 >= sketch.getCodeCount())
(backwards && realCurrentTab - 1 < 0)) || (backwards && realCurrentTab - 1 < 0))
return false; // Can't continue without wrap return false; // Can't continue without wrap
if (backwards) { if (backwards) {
@ -359,7 +360,8 @@ public class FindReplace extends JFrame implements ActionListener {
} }
if (wrapNeeded) if (wrapNeeded)
nextIndex = backwards ? text.lastIndexOf(search) : text.indexOf(search, 0); nextIndex = backwards ? text.lastIndexOf(search) : text.indexOf(search,
0);
} }
if (nextIndex != -1) { if (nextIndex != -1) {
@ -370,10 +372,9 @@ public class FindReplace extends JFrame implements ActionListener {
return false; return false;
} }
/** /**
* Replace the current selection with whatever's in the * Replace the current selection with whatever's in the replacement text
* replacement text field. * field.
*/ */
public void replace() { public void replace() {
if (findField.getText().length() == 0) 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 * Replace the current selection with whatever's in the replacement text
* replacement text field, and then find the next match * field, and then find the next match
*/ */
public void replaceAndFindNext() { public void replaceAndFindNext() {
replace(); replace();
@ -408,8 +409,8 @@ public class FindReplace extends JFrame implements ActionListener {
} }
/** /**
* Replace everything that matches by doing find and replace * Replace everything that matches by doing find and replace alternately until
* alternately until nothing more found. * nothing more found.
*/ */
public void replaceAll() { public void replaceAll() {
if (findField.getText().length() == 0) if (findField.getText().length() == 0)