Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Adding a Project View to the Arduino IDE #11048

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 15 commits into
base: master
Choose a base branch
Loading
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Prev Previous commit
Next Next commit
Icons touchBar added
  • Loading branch information
fati1998 committed Dec 5, 2020
commit 7e3c70e6c23b5a8b0ffb6df604376c41b78d6617
The diff you're trying to view is too large. We only load the first 3000 changed files.
160 changes: 80 additions & 80 deletions 160 app/src/processing/app/Editor.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,18 +107,18 @@ public class Editor extends JFrame implements RunnerListener {
private int currentTabIndex = -1;

private static class ShouldSaveIfModified
implements Predicate<SketchController> {
implements Predicate<SketchController> {

@Override
public boolean test(SketchController controller) {
return PreferencesData.getBoolean("editor.save_on_verify")
&& controller.getSketch().isModified()
&& !controller.isReadOnly();
&& controller.getSketch().isModified()
&& !controller.isReadOnly();
}
}

private static class CanExportInSketchFolder
implements Predicate<SketchController> {
implements Predicate<SketchController> {

@Override
public boolean test(SketchController controller) {
Expand All @@ -138,8 +138,8 @@ public boolean test(SketchController controller) {
// set to blank, it's preferredSize() will be fukered
private static final String EMPTY =
" " +
" " +
" ";
" " +
" ";

/** Command on Mac OS X, Ctrl on Windows and Linux */
private static final int SHORTCUT_KEY_MASK =
Expand Down Expand Up @@ -234,39 +234,39 @@ public Editor(Base ibase, File file, int[] storedLocation, int[] defaultLocation

// add listener to handle window close box hit event
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
base.handleClose(Editor.this);
}
});
public void windowClosing(WindowEvent e) {
base.handleClose(Editor.this);
}
});
// don't close the window when clicked, the app will take care
// of that via the handleQuitInternal() methods
// http://dev.processing.org/bugs/show_bug.cgi?id=440
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);

// When bringing a window to front, let the Base know
addWindowListener(new WindowAdapter() {
public void windowActivated(WindowEvent e) {
base.handleActivated(Editor.this);
}

// added for 1.0.5
// http://dev.processing.org/bugs/show_bug.cgi?id=1260
public void windowDeactivated(WindowEvent e) {
List<Component> toolsMenuItemsToRemove = new LinkedList<>();
for (Component menuItem : toolsMenu.getMenuComponents()) {
if (menuItem instanceof JComponent) {
Object removeOnWindowDeactivation = ((JComponent) menuItem).getClientProperty("removeOnWindowDeactivation");
if (removeOnWindowDeactivation != null && Boolean.valueOf(removeOnWindowDeactivation.toString())) {
toolsMenuItemsToRemove.add(menuItem);
}
public void windowActivated(WindowEvent e) {
base.handleActivated(Editor.this);
}

// added for 1.0.5
// http://dev.processing.org/bugs/show_bug.cgi?id=1260
public void windowDeactivated(WindowEvent e) {
List<Component> toolsMenuItemsToRemove = new LinkedList<>();
for (Component menuItem : toolsMenu.getMenuComponents()) {
if (menuItem instanceof JComponent) {
Object removeOnWindowDeactivation = ((JComponent) menuItem).getClientProperty("removeOnWindowDeactivation");
if (removeOnWindowDeactivation != null && Boolean.valueOf(removeOnWindowDeactivation.toString())) {
toolsMenuItemsToRemove.add(menuItem);
}
}
for (Component menuItem : toolsMenuItemsToRemove) {
toolsMenu.remove(menuItem);
}
toolsMenu.remove(portMenu);
}
});
for (Component menuItem : toolsMenuItemsToRemove) {
toolsMenu.remove(menuItem);
}
toolsMenu.remove(portMenu);
}
});

//PdeKeywords keywords = new PdeKeywords();
//sketchbook = new Sketchbook(this);
Expand Down Expand Up @@ -353,8 +353,8 @@ public void windowDeactivated(WindowEvent e) {

// Set the minimum size for the editor window
setMinimumSize(scale(new Dimension(
PreferencesData.getInteger("editor.window.width.min"),
PreferencesData.getInteger("editor.window.height.min"))));
PreferencesData.getInteger("editor.window.width.min"),
PreferencesData.getInteger("editor.window.height.min"))));

// Bring back the general options for the editor
applyPreferences();
Expand Down Expand Up @@ -941,14 +941,14 @@ private String findClassInZipFile(String base, File file) {
} finally {
if (zipFile != null) {
try {
zipFile.close();
} catch (IOException e) {
// noop
}
}
}
return null;
}
zipFile.close();
} catch (IOException e) {
// noop
}
}
}
return null;
}

public void updateKeywords(PdeKeywords keywords) {
for (EditorTab tab : tabs)
Expand Down Expand Up @@ -1031,7 +1031,7 @@ private void selectSerialPort(String name) {
BaseNoGui.selectSerialPort(name);
try {
boolean reopenMonitor = ((serialMonitor != null && serialMonitor.isVisible()) ||
serialPlotter != null && serialPlotter.isVisible());
serialPlotter != null && serialPlotter.isVisible());
if (serialMonitor != null) {
serialMonitor.close();
}
Expand Down Expand Up @@ -1088,15 +1088,15 @@ private void populatePortMenu() {
ports = platform.filterPorts(ports, PreferencesData.getBoolean("serial.ports.showall"));

ports.stream() //
.filter(port -> port.getProtocolLabel() == null || port.getProtocolLabel().isEmpty())
.forEach(port -> {
int labelIdx = PROTOCOLS_ORDER.indexOf(port.getProtocol());
if (labelIdx != -1) {
port.setProtocolLabel(PROTOCOLS_LABELS.get(labelIdx));
} else {
port.setProtocolLabel(port.getProtocol());
}
});
.filter(port -> port.getProtocolLabel() == null || port.getProtocolLabel().isEmpty())
.forEach(port -> {
int labelIdx = PROTOCOLS_ORDER.indexOf(port.getProtocol());
if (labelIdx != -1) {
port.setProtocolLabel(PROTOCOLS_LABELS.get(labelIdx));
} else {
port.setProtocolLabel(port.getProtocol());
}
});

Collections.sort(ports, (port1, port2) -> {
String pr1 = port1.getProtocol();
Expand Down Expand Up @@ -1193,9 +1193,9 @@ private JMenu buildEditMenu() {
menu.add(undoItem);

if (!OSUtils.isMacOS()) {
redoItem = newJMenuItem(tr("Redo"), 'Y');
redoItem = newJMenuItem(tr("Redo"), 'Y');
} else {
redoItem = newJMenuItemShift(tr("Redo"), 'Z');
redoItem = newJMenuItemShift(tr("Redo"), 'Z');
}
redoItem.setName("menuEditRedo");
redoItem.addActionListener(event -> getCurrentTab().handleRedo());
Expand Down Expand Up @@ -1549,8 +1549,8 @@ public void reorderTabs() {
protected void addTab(SketchFile file, String contents) throws IOException {
EditorTab tab = new EditorTab(this, file, contents);
tab.getTextArea().getDocument()
.addDocumentListener(new DocumentTextChangeListener(
() -> updateUndoRedoState()));
.addDocumentListener(new DocumentTextChangeListener(
() -> updateUndoRedoState()));
tabs.add(tab);
reorderTabs();
}
Expand Down Expand Up @@ -1637,8 +1637,8 @@ public void run() {
statusNotice(tr("Done compiling."));
} catch (PreferencesMapException e) {
statusError(I18n.format(
tr("Error while compiling: missing '{0}' configuration parameter"),
e.getMessage()));
tr("Error while compiling: missing '{0}' configuration parameter"),
e.getMessage()));
} catch (Exception e) {
status.unprogress();
statusError(e);
Expand Down Expand Up @@ -1697,13 +1697,13 @@ protected boolean checkModified() {
toFront();

String prompt = I18n.format(tr("Save changes to \"{0}\"? "),
sketch.getName());
sketch.getName());

if (!OSUtils.hasMacOSStyleMenus()) {
int result =
JOptionPane.showConfirmDialog(this, prompt, tr("Close"),
JOptionPane.YES_NO_CANCEL_OPTION,
JOptionPane.QUESTION_MESSAGE);
JOptionPane.YES_NO_CANCEL_OPTION,
JOptionPane.QUESTION_MESSAGE);

switch (result) {
case JOptionPane.YES_OPTION:
Expand All @@ -1728,14 +1728,14 @@ protected boolean checkModified() {

JOptionPane pane =
new JOptionPane(tr("<html> " +
"<head> <style type=\"text/css\">"+
"b { font: 13pt \"Lucida Grande\" }"+
"p { font: 11pt \"Lucida Grande\"; margin-top: 8px }"+
"</style> </head>" +
"<b>Do you want to save changes to this sketch<BR>" +
" before closing?</b>" +
"<p>If you don't save, your changes will be lost."),
JOptionPane.QUESTION_MESSAGE);
"<head> <style type=\"text/css\">"+
"b { font: 13pt \"Lucida Grande\" }"+
"p { font: 11pt \"Lucida Grande\"; margin-top: 8px }"+
"</style> </head>" +
"<b>Do you want to save changes to this sketch<BR>" +
" before closing?</b>" +
"<p>If you don't save, your changes will be lost."),
JOptionPane.QUESTION_MESSAGE);

String[] options = new String[] {
tr("Save"), tr("Cancel"), tr("Don't Save")
Expand Down Expand Up @@ -1856,10 +1856,10 @@ public void updateTitle() {
} else {
if (current.isPrimary()) {
setTitle(I18n.format(tr("{0} | Arduino {1}"), sketch.getName(),
BaseNoGui.VERSION_NAME_LONG));
BaseNoGui.VERSION_NAME_LONG));
} else {
setTitle(I18n.format(tr("{0} - {1} | Arduino {2}"), sketch.getName(),
current.getFileName(), BaseNoGui.VERSION_NAME_LONG));
current.getFileName(), BaseNoGui.VERSION_NAME_LONG));
}
}
}
Expand Down Expand Up @@ -1888,10 +1888,10 @@ public boolean handleSave(boolean immediately) {

} else {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
handleSave2();
}
});
public void run() {
handleSave2();
}
});
}
return true;
}
Expand Down Expand Up @@ -1997,8 +1997,8 @@ private boolean serialPrompt() {
}
String question = tr("Retry the upload with another serial port?");
BoardPortJCheckBoxMenuItem result = (BoardPortJCheckBoxMenuItem) JOptionPane
.showInputDialog(this, title + "\n" + question, title,
JOptionPane.PLAIN_MESSAGE, null, items.toArray(), 0);
.showInputDialog(this, title + "\n" + question, title,
JOptionPane.PLAIN_MESSAGE, null, items.toArray(), 0);
if (result == null)
return false;
result.doClick();
Expand Down Expand Up @@ -2072,8 +2072,8 @@ public void run() {
}
} catch (PreferencesMapException e) {
statusError(I18n.format(
tr("Error while uploading: missing '{0}' configuration parameter"),
e.getMessage()));
tr("Error while uploading: missing '{0}' configuration parameter"),
e.getMessage()));
} catch (RunnerException e) {
//statusError("Error during upload.");
//e.printStackTrace();
Expand Down Expand Up @@ -2106,7 +2106,7 @@ private void resumeOrCloseSerialMonitor() {
try {
Thread.sleep(200);
} catch (InterruptedException e) {
// noop
// noop
}
BoardPort boardPort = BaseNoGui.getDiscoveryManager().find(PreferencesData.get("serial.port"));
long sleptFor = 0;
Expand All @@ -2132,7 +2132,7 @@ private void resumeOrCloseSerialMonitor() {
} catch (Exception e) {
statusError(e);
}
}
}
}

private void resumeOrCloseSerialPlotter() {
Expand All @@ -2151,7 +2151,7 @@ private void resumeOrCloseSerialPlotter() {
} catch (Exception e) {
statusError(e);
}
}
}
}

class TimeoutUploadHandler implements Runnable {
Expand All @@ -2164,7 +2164,7 @@ public void run() {
avoidMultipleOperations = false;
}
} catch (InterruptedException e) {
// noop
// noop
}
}
}
Expand Down
5 changes: 0 additions & 5 deletions 5 app/src/processing/app/EditorProject.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,8 @@ public EditorProject(String path, Base base, Editor editor){
settingsbox.setOpaque(true);
settingsbox.setBackground(new Color(23, 161, 165));
this.path = path;

Icon img = new ImageIcon(new ImageIcon("folder1.jpg").getImage().getScaledInstance(35, 30, Image.SCALE_DEFAULT));
settings = new JButton(img);


settings.setPreferredSize(new Dimension(25, 5));
settings.addActionListener(this);
Expand Down Expand Up @@ -125,6 +123,3 @@ public void actionPerformed(ActionEvent e) {


}



Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.