mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
added help items
This commit is contained in:
+4
-2
@@ -14,14 +14,16 @@ public enum IconLoader {
|
|||||||
"disk_blue.png"), SaveAs("save_as.png"), Exit("exit.png"), DocumentPlainYellow(
|
"disk_blue.png"), SaveAs("save_as.png"), Exit("exit.png"), DocumentPlainYellow(
|
||||||
"document_plain_yellow.png"), PhotoScenery("photo_scenery.png"), LightBulbOn(
|
"document_plain_yellow.png"), PhotoScenery("photo_scenery.png"), LightBulbOn(
|
||||||
"lightbulb_on.png"), LightBulbOff("lightbulb_off.png"), NotebookAdd("notebook_add.png"), FormGreen(
|
"lightbulb_on.png"), LightBulbOff("lightbulb_off.png"), NotebookAdd("notebook_add.png"), FormGreen(
|
||||||
"form_green.png"), Gears("gears.png"), About("about.png"), Donate("donate.gif"), WindowColors(
|
"form_green.png"), Gears("gears.png"), About("about.png"), WindowColors(
|
||||||
"window_colors.png"), WindowGear("window_gear.png"), NavigateCheck("navigate_check.png"), Undo(
|
"window_colors.png"), WindowGear("window_gear.png"), NavigateCheck("navigate_check.png"), Undo(
|
||||||
"undo.png"), Error("error.png"), Warning("warning.png"), ZoomSmall("zoom_small.png"), MoveSmall(
|
"undo.png"), Error("error.png"), Warning("warning.png"), ZoomSmall("zoom_small.png"), MoveSmall(
|
||||||
"move_small.png"), Print("print.png"), PDF("pdf.png"), Excel("excel.png"), CSV(
|
"move_small.png"), Print("print.png"), PDF("pdf.png"), Excel("excel.png"), CSV(
|
||||||
"csv.png"), HTML("html.png"), Image("image.png"), Cut("cut.png"), Copy("copy.png"), Paste(
|
"csv.png"), HTML("html.png"), Image("image.png"), Cut("cut.png"), Copy("copy.png"), Paste(
|
||||||
"paste.png"), Selection("selection.png"), BOM("bom.png"), BlackBoard("blackboard.png"), IdCard(
|
"paste.png"), Selection("selection.png"), BOM("bom.png"), BlackBoard("blackboard.png"), IdCard(
|
||||||
"id_card.png"), IdCardAdd("id_card_add.png"), Chest("chest.png"), Upload("upload.png"), Wrench(
|
"id_card.png"), IdCardAdd("id_card_add.png"), Chest("chest.png"), Upload("upload.png"), Wrench(
|
||||||
"wrench.png"), Group("group.png"), Ungroup("ungroup.png"), TraceMask("trace_mask.png");
|
"wrench.png"), Group("group.png"), Ungroup("ungroup.png"), TraceMask("trace_mask.png"), Faq(
|
||||||
|
"faq.png"), Component("component.png"), Plugin("plugin.png"), Manual("manual.png"), Donate(
|
||||||
|
"donate.png"), Bug("bug.png");
|
||||||
|
|
||||||
protected String name;
|
protected String name;
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 850 B |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 901 B |
Binary file not shown.
|
After Width: | Height: | Size: 845 B |
Binary file not shown.
|
After Width: | Height: | Size: 990 B |
Binary file not shown.
|
After Width: | Height: | Size: 833 B |
Binary file not shown.
|
After Width: | Height: | Size: 838 B |
+37
@@ -4,6 +4,7 @@ import java.awt.event.ActionEvent;
|
|||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
|
|
||||||
import javax.swing.AbstractAction;
|
import javax.swing.AbstractAction;
|
||||||
|
import javax.swing.Icon;
|
||||||
|
|
||||||
import org.diylc.common.EventType;
|
import org.diylc.common.EventType;
|
||||||
import org.diylc.common.IPlugIn;
|
import org.diylc.common.IPlugIn;
|
||||||
@@ -12,6 +13,7 @@ import org.diylc.gui.DialogFactory;
|
|||||||
import org.diylc.images.IconLoader;
|
import org.diylc.images.IconLoader;
|
||||||
|
|
||||||
import com.diyfever.gui.AboutDialog;
|
import com.diyfever.gui.AboutDialog;
|
||||||
|
import com.diyfever.gui.miscutils.Utils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Entry point class for help-related utilities.
|
* Entry point class for help-related utilities.
|
||||||
@@ -29,6 +31,22 @@ public class HelpManager implements IPlugIn {
|
|||||||
public void connect(IPlugInPort plugInPort) {
|
public void connect(IPlugInPort plugInPort) {
|
||||||
this.plugInPort = plugInPort;
|
this.plugInPort = plugInPort;
|
||||||
|
|
||||||
|
plugInPort.injectMenuAction(new NavigateURLAction("User Manual", IconLoader.Manual
|
||||||
|
.getIcon(), "http://code.google.com/p/diy-layout-creator/wiki/Manual"), HELP_TITLE);
|
||||||
|
plugInPort.injectMenuAction(new NavigateURLAction("FAW", IconLoader.Faq.getIcon(),
|
||||||
|
"http://code.google.com/p/diy-layout-creator/wiki/FAQ"), HELP_TITLE);
|
||||||
|
plugInPort.injectMenuAction(new NavigateURLAction("Component API", IconLoader.Component
|
||||||
|
.getIcon(), "http://code.google.com/p/diy-layout-creator/wiki/ComponentAPI"),
|
||||||
|
HELP_TITLE);
|
||||||
|
plugInPort.injectMenuAction(new NavigateURLAction("Plugin API",
|
||||||
|
IconLoader.Plugin.getIcon(),
|
||||||
|
"http://code.google.com/p/diy-layout-creator/wiki/PluginAPI"), HELP_TITLE);
|
||||||
|
plugInPort.injectMenuAction(new NavigateURLAction("Submit a Bug", IconLoader.Bug.getIcon(),
|
||||||
|
"http://code.google.com/p/diy-layout-creator/issues/entry"), HELP_TITLE);
|
||||||
|
plugInPort.injectMenuAction(null, HELP_TITLE);
|
||||||
|
plugInPort.injectMenuAction(new NavigateURLAction("Donate", IconLoader.Donate.getIcon(),
|
||||||
|
"https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=25161"),
|
||||||
|
HELP_TITLE);
|
||||||
plugInPort.injectMenuAction(new AboutAction(), HELP_TITLE);
|
plugInPort.injectMenuAction(new AboutAction(), HELP_TITLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,4 +84,23 @@ public class HelpManager implements IPlugIn {
|
|||||||
getAboutDialog().setVisible(true);
|
getAboutDialog().setVisible(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class NavigateURLAction extends AbstractAction {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
public NavigateURLAction(String name, Icon icon, String url) {
|
||||||
|
super();
|
||||||
|
this.url = url;
|
||||||
|
putValue(AbstractAction.NAME, name);
|
||||||
|
putValue(AbstractAction.SMALL_ICON, icon);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
Utils.openURL(url);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user