From: Fabian Stemmler Date: Mon, 15 Jul 2019 15:00:57 +0000 (+0200) Subject: Merge branch 'development' of https://gitlab.lrz.de/lrr-tum/students/eragp-misim... X-Git-Url: https://mograsim.net/gitweb/?a=commitdiff_plain;h=9e9a77976efe36de6ae82e74a013cd07a17dd352;p=Mograsim.git Merge branch 'development' of https://gitlab.lrz.de/lrr-tum/students/eragp-misim-2019 into development --- 9e9a77976efe36de6ae82e74a013cd07a17dd352 diff --cc net.mograsim.logic.model.editor/src/net/mograsim/logic/model/editor/ui/EditorGUI.java index 06f9f4b7,2827f249..28e28554 --- a/net.mograsim.logic.model.editor/src/net/mograsim/logic/model/editor/ui/EditorGUI.java +++ b/net.mograsim.logic.model.editor/src/net/mograsim/logic/model/editor/ui/EditorGUI.java @@@ -1,5 -1,5 +1,7 @@@ package net.mograsim.logic.model.editor.ui; ++import java.io.IOException; ++ import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionListener; @@@ -81,33 -67,7 +83,41 @@@ public class EditorGU new ZoomableCanvasOverlay(logicCanvas, null).enableScale(); } - private ToolBar setupToolBar() + private ToolBar setupTopToolBar(Composite parent) + { + GridData d = new GridData(); + d.grabExcessHorizontalSpace = true; + d.horizontalAlignment = SWT.FILL; + + ToolBar toolBar = new ToolBar(parent, SWT.BORDER); + toolBar.setLayoutData(d); + + ToolItem file = new ToolItem(toolBar, SWT.DROP_DOWN); + + //TODO +// DropDownEntry newEntry = new DropDownEntry("New", e -> { +// }); - DropDownEntry loadEntry = new DropDownEntry("Load", e -> SaveLoadManager.openLoadDialog()); ++ DropDownEntry loadEntry = new DropDownEntry("Load", e -> { ++ try ++ { ++ SaveLoadManager.openLoadDialog(); ++ } catch (IOException e1) ++ { ++ editor.dialogManager.openWarningDialog("Failed to load Component!", e1.getMessage()); ++ } ++ }); + DropDownEntry saveEntry = new DropDownEntry("Save", e -> editor.save()); + DropDownEntry saveAsEntry = new DropDownEntry("Save as...", e -> editor.saveAs()); + + DropDownEntry[] entries = new DropDownEntry[] { loadEntry, saveEntry, saveAsEntry}; + + setupDrowpDownMenu(file, entries); + + file.setText("File"); + return toolBar; + } + + private ToolBar setupBottomToolBar(Composite parent) { GridData d = new GridData(); d.grabExcessHorizontalSpace = true;