-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from DJ-Raven/fix-push-popup
Drawer support dynamic submenu
- Loading branch information
Showing
20 changed files
with
485 additions
and
234 deletions.
There are no files selected for viewing
Binary file renamed
BIN
+96.5 KB
jar library/swing-glasspane-popup-1.3.0.jar → jar library/swing-glasspane-popup-1.4.0.jar
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
201 changes: 136 additions & 65 deletions
201
src/main/java/raven/drawer/component/menu/SimpleMenu.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
package raven.drawer.component.menu.data; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class Item implements MenuItem { | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public String getIcon() { | ||
return icon; | ||
} | ||
|
||
public List<Item> getSubMenu() { | ||
return subMenu; | ||
} | ||
|
||
private final String name; | ||
private String icon; | ||
private List<Item> subMenu; | ||
|
||
public Item(String name) { | ||
this.name = name; | ||
} | ||
|
||
public Item(String name, String icon) { | ||
this.name = name; | ||
this.icon = icon; | ||
} | ||
|
||
public Item subMenu(Item item) { | ||
addSubMenu(item); | ||
return this; | ||
} | ||
|
||
public Item subMenu(String name) { | ||
addSubMenu(new Item(name)); | ||
return this; | ||
} | ||
|
||
private void addSubMenu(Item item) { | ||
if (subMenu == null) { | ||
subMenu = new ArrayList<>(); | ||
} | ||
subMenu.add(item); | ||
} | ||
|
||
public boolean isSubmenuAble() { | ||
return subMenu != null; | ||
} | ||
|
||
@Override | ||
public boolean isMenu() { | ||
return true; | ||
} | ||
|
||
public static class Label implements MenuItem { | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
private String name; | ||
|
||
public Label(String name) { | ||
this.name = name; | ||
} | ||
|
||
@Override | ||
public boolean isMenu() { | ||
return false; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package raven.drawer.component.menu.data; | ||
|
||
public interface MenuItem { | ||
|
||
boolean isMenu(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.