mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-07 12:24:58 +10:00
Added standard models in the drop down menu of the component toolbar
This commit is contained in:
@@ -271,7 +271,6 @@ public class CanvasPlugin implements IPlugIn, ClipboardOwner {
|
||||
|
||||
@Override
|
||||
public void mousePressed(MouseEvent e) {
|
||||
LOG.info("Pressed: " + e.isPopupTrigger());
|
||||
canvasPanel.requestFocus();
|
||||
pressedEvent = e;
|
||||
}
|
||||
|
||||
@@ -430,6 +430,17 @@ class ComponentTabbedPane extends JTabbedPane {
|
||||
variantPopup.add(new SelectAllAction(plugInPort, componentType));
|
||||
variantPopup.add(shortcutSubmenu);
|
||||
variantPopup.add(new JSeparator());
|
||||
|
||||
if (componentType.getDatasheet() != null && !componentType.getDatasheet().isEmpty()) {
|
||||
List<Component> items = ComponentButtonFactory.createDatasheetItems(plugInPort, componentType, new ArrayList<String>(), model -> {
|
||||
LOG.info("Creating datasheet model " + String.join(", ", model));
|
||||
plugInPort.setNewComponentTypeSlot(componentType, null, model, false);
|
||||
});
|
||||
for (Component item : items) {
|
||||
variantPopup.add(item);
|
||||
}
|
||||
variantPopup.add(new JSeparator());
|
||||
}
|
||||
|
||||
List<Template> templates = plugInPort.getVariantsFor(componentType);
|
||||
if (templates == null || templates.isEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user