{"id":3039,"date":"2013-07-28T14:31:07","date_gmt":"2013-07-28T05:31:07","guid":{"rendered":"http:\/\/www.lancard.com\/blog\/?p=3039"},"modified":"2025-03-12T11:28:45","modified_gmt":"2025-03-12T02:28:45","slug":"cobol%e3%82%a8%e3%83%87%e3%82%a3%e3%82%bf%e3%82%92%e4%bd%9c%e6%88%90%e3%81%97%e3%81%a6%e3%81%bf%e3%82%8b%e3%80%82","status":"publish","type":"post","link":"https:\/\/www.lancard.com\/blog\/2013\/07\/28\/cobol%e3%82%a8%e3%83%87%e3%82%a3%e3%82%bf%e3%82%92%e4%bd%9c%e6%88%90%e3%81%97%e3%81%a6%e3%81%bf%e3%82%8b%e3%80%82\/","title":{"rendered":"COBOL\u30a8\u30c7\u30a3\u30bf\u3092\u4f5c\u6210\u3057\u3066\u307f\u308b\u3002"},"content":{"rendered":"<p>Eclipse\u30d7\u30e9\u30b0\u30a4\u30f3\u3068\u3057\u3066COBOL\u30a8\u30c7\u30a3\u30bf\u3092\u4f5c\u6210\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>1.org.eclipse.jdt.ui\u306e\u30bd\u30fc\u30b9\u3092\u30a4\u30f3\u30dd\u30fc\u30c8<br \/>\n\u3000\u3000Eclipse\u3067\u30a8\u30c7\u30a3\u30bf\u3068\u8a00\u3048\u3070JavaEditor\u3067\u3059\u306e\u3067\u3001\u3053\u308c\u3092\u53c2\u8003\u306b\u4f5c\u3063\u3066\u307f\u307e\u3059\u3002<br \/>\n\u3000\u3000JavaEditor\u306forg.eclipse.jdt.ui\u306e\u4e2d\u306b\u3042\u308b\u306e\u3067\u3001<br \/>\n\u3000\u3000\u3053\u3053\u306e\u30bd\u30fc\u30b9\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3057\u307e\u3059\u3002<\/p>\n<p>(1)\u30a4\u30f3\u30dd\u30fc\u30c8\u3092\u9078\u629e\u3057\u307e\u3059\u3002<br \/>\n<a href=\"http:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2013\/07\/import1.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2013\/07\/import1.png\" alt=\"\" title=\"import1\" width=\"224\" height=\"245\" class=\"aligncenter size-full wp-image-3040\" \/><\/a><br \/>\n(2)Plug-in Development\u306ePlug-ins and Fragments\u3092\u9078\u629e\u3057\u307e\u3059\u3002<br \/>\n<a href=\"http:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2013\/07\/import2.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2013\/07\/import2.png\" alt=\"\" title=\"import2\" width=\"236\" height=\"143\" class=\"aligncenter size-full wp-image-3041\" \/><\/a><br \/>\n(3)Import As\u306eProjects with source folders\u3092\u9078\u629e\u3057\u307e\u3059\u3002<br \/>\n<a href=\"http:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2013\/07\/import3.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2013\/07\/import3.png\" alt=\"\" title=\"import3\" width=\"249\" height=\"138\" class=\"aligncenter size-full wp-image-3042\" \/><\/a><br \/>\n(4)ID\u306b\u300corg.eclipse.jdt.ui\u300d\u3092\u5165\u529b\u3057\u3001Add\u3057\u307e\u3059\u3002<br \/>\n\u3000\u3000\u3042\u3068\u306fFinish\u3059\u308c\u3070\u30bd\u30fc\u30b9\u304c\u30a4\u30f3\u30dd\u30fc\u30c8\u3055\u308c\u307e\u3059\u3002<br \/>\n<a href=\"http:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2013\/07\/import4.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2013\/07\/import4-400x342.png\" alt=\"\" title=\"import4\" width=\"400\" height=\"342\" class=\"aligncenter size-medium wp-image-3043\" srcset=\"https:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2013\/07\/import4-400x342.png 400w, https:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2013\/07\/import4-602x514.png 602w, https:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2013\/07\/import4.png 732w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><\/a><\/p>\n<p>2.COBOLEditor<br \/>\nCOBOLEditor\u306f\u30b7\u30f3\u30d7\u30eb\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u66f8\u304d\u307e\u3057\u305f\u3002<br \/>\nJavaEditor\u306f\u8272\u3005\u306a\u6a5f\u80fd\u304c\u5b9f\u88c5\u3055\u308c\u3066\u3044\u307e\u3059\u304c\u3001\u3072\u3068\u307e\u305a\u4e88\u7d04\u8a9e\u306e\u5f37\u8abf\u8868\u793a\u306e\u307f\u3068\u3044\u3046\u3053\u3068\u3067<br \/>\n\u3053\u306e\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre line=\"1\" lang=\"java\">\r\nimport org.eclipse.ui.editors.text.TextEditor;\r\n\r\npublic class COBOLEditor extends TextEditor {\r\n\r\nprivate COBOLColorManager colorManager;\r\n\r\npublic COBOLEditor() {\r\nsuper();\r\ncolorManager = new COBOLColorManager();\r\nsetSourceViewerConfiguration(new COBOLSourceViewerConfiguration(colorManager));\r\n}\r\npublic void dispose() {\r\ncolorManager.dispose();\r\nsuper.dispose();\r\n}\r\n\r\n}\r\n<\/pre>\n<p>3.COBOLSourceViewerConfiguration<br \/>\nSourceViewerConfiguration\u306f\u6b21\u306e\u3088\u3046\u306b\u5b9f\u88c5\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u4e88\u7d04\u8a9e\u3068\u6587\u5b57\u5217\u306b\u8272\u3092\u3064\u3051\u308b\u3068\u3053\u308d\u307e\u3067\u3067\u3001\u30b3\u30e1\u30f3\u30c8\u306b\u3064\u3044\u3066\u306f\u51e6\u7406\u306f\u3057\u3066\u3044\u307e\u305b\u3093\u3002<\/p>\n<pre line=\"1\" lang=\"java\">\r\npublic class COBOLSourceViewerConfiguration extends TextSourceViewerConfiguration {\r\nprivate COBOLCodeScanner fCodeScanner = null;\r\nprivate SingleTokenCOBOLScanner fStringScanner = null;\r\npublic COBOLSourceViewerConfiguration(COBOLColorManager colorManager){\r\nfCodeScanner = new COBOLCodeScanner(colorManager);\r\nfStringScanner= new SingleTokenCOBOLScanner(colorManager, ICOBOLColorConstants.COBOL_STRING);\r\n}\r\n\r\n@Override\r\npublic IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {\r\nPresentationReconciler reconciler = new PresentationReconciler();\r\n\r\nDefaultDamagerRepairer dr = new DefaultDamagerRepairer(fCodeScanner);\r\nreconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);\r\nreconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);\r\n\r\ndr= new DefaultDamagerRepairer(fStringScanner);\r\nreconciler.setDamager(dr, ICOBOLColorConstants.COBOL_STRING);\r\nreconciler.setRepairer(dr, ICOBOLColorConstants.COBOL_STRING);\r\n\r\nreturn reconciler;\r\n}\r\n}\r\n<\/pre>\n<p>4.\u5f37\u8abf\u8868\u793a<br \/>\nJavaEditor\u306f\u8a2d\u5b9a\u753b\u9762(PreferenceStore)\u304b\u3089\u4f55\u8272\u306b\u3059\u308b\u304b\u3092\u53d6\u5f97\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n<a href=\"http:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2013\/07\/d124fff4a4a5c14317a8e9ab15cfebef.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2013\/07\/d124fff4a4a5c14317a8e9ab15cfebef-400x161.png\" alt=\"\" title=\"JavaEditor\u306e\u8a2d\u5b9a\u753b\u9762\" width=\"400\" height=\"161\" class=\"aligncenter size-medium wp-image-3044\" srcset=\"https:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2013\/07\/d124fff4a4a5c14317a8e9ab15cfebef-400x161.png 400w, https:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2013\/07\/d124fff4a4a5c14317a8e9ab15cfebef-602x243.png 602w, https:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2013\/07\/d124fff4a4a5c14317a8e9ab15cfebef.png 807w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><\/a><br \/>\n\u4ee5\u4e0b\u306f\u305d\u306e\u90e8\u5206<\/p>\n<pre line=\"1\" lang=\"java\">\r\nif (fColorManager != null && colorKey != null && fColorManager.getColor(colorKey) == null) {\r\nRGB rgb= PreferenceConverter.getColor(fPreferenceStore, colorKey);\r\nif (fColorManager instanceof IColorManagerExtension) {\r\nIColorManagerExtension ext= (IColorManagerExtension) fColorManager;\r\next.unbindColor(colorKey);\r\next.bindColor(colorKey, rgb);\r\n}\r\n}\r\n<\/pre>\n<p>\u4eca\u56de\u306f\u3001\u8a2d\u5b9a\u753b\u9762\u306f\u3042\u3068\u3067\u4f5c\u308b\u3068\u3057\u3066\u30bd\u30fc\u30b9\u4e0a\u306b\u76f4\u66f8\u304d\u3057\u307e\u3059\u3002<\/p>\n<pre line=\"1\" lang=\"java\">\r\nif (fColorManager != null && colorKey != null && fColorManager.getColor(colorKey) == null) {\r\nRGB rgb = null;\r\nif(colorKey.equals(ICOBOLColorConstants.COBOL_KEYWORD)){\r\nrgb = new RGB(139, 32, 82);\r\n}else if(colorKey.equals(ICOBOLColorConstants.COBOL_STRING)){\r\nrgb = new RGB(63, 44, 250);\r\n}else if(colorKey.equals(ICOBOLColorConstants.COBOL_DEFAULT)){\r\nrgb = new RGB(0, 0, 0);\r\n}else if(colorKey.equals(ICOBOLColorConstants.COBOL_KEYWORD_RETURN)){\r\nrgb = new RGB(139, 32, 82);\r\n}else if(colorKey.equals(ICOBOLColorConstants.COBOL_OPERATOR)){\r\nrgb = new RGB(0, 0, 0);\r\n}else if(colorKey.equals(ICOBOLColorConstants.COBOL_BRACKET)){\r\nrgb = new RGB(0, 0, 0);\r\n}else{\r\nrgb = new RGB(0, 0, 0);\r\n}\r\n\r\nif (fColorManager instanceof IColorManagerExtension) {\r\nIColorManagerExtension ext= (IColorManagerExtension) fColorManager;\r\next.unbindColor(colorKey);\r\next.bindColor(colorKey, rgb);\r\n}\r\n}\r\n<\/pre>\n<p>5.\u52d5\u304b\u3057\u3066\u307f\u308b\u3002<br \/>\n\u3000\u3000\u3061\u3083\u3093\u3068\u4e88\u7d04\u8a9e\u304c\u5f37\u8abf\u8868\u793a\u3055\u308c\u307e\u3057\u305f\u3002<br \/>\n\u3000\u3000\u6587\u5b57\u5217\u3082\u9752\u8272\u306b\u306a\u3063\u3066\u3044\u3066\u307e\u3059\u3002<br \/>\n<a href=\"http:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2013\/07\/acfb99262ea38c2d77640e69e9f71718.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2013\/07\/acfb99262ea38c2d77640e69e9f71718-400x117.png\" alt=\"\" title=\"\u52d5\u304b\u3057\u3066\u307f\u308b\u3002\" width=\"400\" height=\"117\" class=\"aligncenter size-medium wp-image-3045\" srcset=\"https:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2013\/07\/acfb99262ea38c2d77640e69e9f71718-400x117.png 400w, https:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2013\/07\/acfb99262ea38c2d77640e69e9f71718.png 523w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><\/a><\/p>\n<p>\u6b21\u56de\u306f\u8272\u3092\u8a2d\u5b9a\u753b\u9762\u304b\u3089\u53d6\u5f97\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-facebook nolightbox\" data-provider=\"facebook\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Facebook\" href=\"https:\/\/www.facebook.com\/sharer.php?u=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F3039&#038;t=COBOL%E3%82%A8%E3%83%87%E3%82%A3%E3%82%BF%E3%82%92%E4%BD%9C%E6%88%90%E3%81%97%E3%81%A6%E3%81%BF%E3%82%8B%E3%80%82&#038;s=100&#038;p&#091;url&#093;=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F3039&#038;p&#091;images&#093;&#091;0&#093;=http%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-content%2Fuploads%2F2013%2F07%2Fimport1.png&#038;p&#091;title&#093;=COBOL%E3%82%A8%E3%83%87%E3%82%A3%E3%82%BF%E3%82%92%E4%BD%9C%E6%88%90%E3%81%97%E3%81%A6%E3%81%BF%E3%82%8B%E3%80%82\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"Facebook\" title=\"Share on Facebook\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/facebook.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-twitter nolightbox\" data-provider=\"twitter\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Twitter\" href=\"http:\/\/twitter.com\/share?url=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F3039&#038;text=COBOL%E3%82%A8%E3%83%87%E3%82%A3%E3%82%BF%E3%82%92%E4%BD%9C%E6%88%90%E3%81%97%E3%81%A6%E3%81%BF%E3%82%8B%E3%80%82\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"twitter\" title=\"Share on Twitter\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/twitter.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-linkedin nolightbox\" data-provider=\"linkedin\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Linkedin\" href=\"https:\/\/www.linkedin.com\/shareArticle?mini=true&#038;url=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F3039&#038;title=COBOL%E3%82%A8%E3%83%87%E3%82%A3%E3%82%BF%E3%82%92%E4%BD%9C%E6%88%90%E3%81%97%E3%81%A6%E3%81%BF%E3%82%8B%E3%80%82\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"linkedin\" title=\"Share on Linkedin\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/linkedin.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-tumblr nolightbox\" data-provider=\"tumblr\" target=\"_blank\" rel=\"nofollow\" title=\"Share on tumblr\" href=\"https:\/\/tumblr.com\/share?s=&#038;v=3&#038;t=COBOL%E3%82%A8%E3%83%87%E3%82%A3%E3%82%BF%E3%82%92%E4%BD%9C%E6%88%90%E3%81%97%E3%81%A6%E3%81%BF%E3%82%8B%E3%80%82&#038;u=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F3039\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"tumblr\" title=\"Share on tumblr\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/tumblr.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-mail nolightbox\" data-provider=\"mail\" rel=\"nofollow\" title=\"Share by email\" href=\"mailto:?subject=COBOL%E3%82%A8%E3%83%87%E3%82%A3%E3%82%BF%E3%82%92%E4%BD%9C%E6%88%90%E3%81%97%E3%81%A6%E3%81%BF%E3%82%8B%E3%80%82&#038;body=%E3%82%B7%E3%82%A7%E3%82%A2%E3%81%99%E3%82%8B%EF%BC%9A:%20https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F3039\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"mail\" title=\"Share by email\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/mail.png\" \/><\/a>","protected":false},"excerpt":{"rendered":"<p>Eclipse\u30d7\u30e9\u30b0\u30a4\u30f3\u3068\u3057\u3066COBOL\u30a8\u30c7\u30a3\u30bf\u3092\u4f5c\u6210\u3057\u3066\u307f\u307e\u3059\u3002 1.org.eclipse.jdt.ui\u306e\u30bd\u30fc\u30b9\u3092\u30a4\u30f3\u30dd\u30fc\u30c8 \u3000\u3000Eclipse\u3067\u30a8\u30c7\u30a3\u30bf\u3068\u8a00\u3048\u3070JavaEditor\u3067\u3059\u306e\u3067\u3001\u3053\u308c\u3092\u53c2\u8003\u306b\u4f5c\u3063\u3066\u307f\u307e\u3059 [&hellip;]<\/p>\n","protected":false},"author":21,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[67,9],"tags":[],"class_list":["post-3039","post","type-post","status-publish","format-standard","hentry","category-eclipse","category-opencobol"],"_links":{"self":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts\/3039","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/users\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/comments?post=3039"}],"version-history":[{"count":7,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts\/3039\/revisions"}],"predecessor-version":[{"id":3052,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts\/3039\/revisions\/3052"}],"wp:attachment":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/media?parent=3039"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/categories?post=3039"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/tags?post=3039"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}