Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Jessica Hawkwell
/
lang-toolkit
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
2
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 54367d6b
authored
Jul 15, 2017
by
Jessica Hawkwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor simplification, adding services support
1 parent
a08f4705
Pipeline
#195
passed
in 17 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
8 deletions
apps/langbuilder/src/main/java/me/felinewith/lang_toolkit/apps/langbuilder/LangBuilder.java
library/liblangbuilder/src/main/java/me/felinewith/lang_toolkit/library/ILangPlugin.java
library/libservices/src/main/java/me/felinewith/lang_toolkit/library/ILangService.java
apps/langbuilder/src/main/java/me/felinewith/lang_toolkit/apps/langbuilder/LangBuilder.java
View file @
54367d6
...
@@ -219,6 +219,12 @@ public final class LangBuilder implements IStrappedApp {
...
@@ -219,6 +219,12 @@ public final class LangBuilder implements IStrappedApp {
plugins
.
put
(
plugin
.
getName
(),
plugin
);
plugins
.
put
(
plugin
.
getName
(),
plugin
);
}
@Override
public
void
start
()
{
plugins
.
forEach
((
name
,
plugin
)
->
{
final
String
t
=
"plugin."
.
concat
(
name
);
boolean
needShowWindow
=
true
;
boolean
needShowWindow
=
true
;
if
(
plugin
.
hasButton
()
)
{
if
(
plugin
.
hasButton
()
)
{
JButton
button
=
plugin
.
getButton
();
JButton
button
=
plugin
.
getButton
();
...
@@ -259,21 +265,19 @@ public final class LangBuilder implements IStrappedApp {
...
@@ -259,21 +265,19 @@ public final class LangBuilder implements IStrappedApp {
if
(
plugin
.
hasToolBar
()
)
{
if
(
plugin
.
hasToolBar
()
)
{
JToolBar
jt
=
plugin
.
getToolBar
();
JToolBar
jt
=
plugin
.
getToolBar
();
jt
.
setName
(
"plugin."
.
concat
(
plugin
.
getName
())
);
jt
.
setName
(
t
);
jTabbedPane
.
addTab
(
plugin
.
getDisplayName
(),
jt
);
jTabbedPane
.
addTab
(
plugin
.
getDisplayName
(),
jt
);
needShowWindow
=
false
;
needShowWindow
=
false
;
}
}
if
(
needShowWindow
&&
plugin
.
hasWindow
()
)
{
if
(
needShowWindow
&&
plugin
.
hasWindow
()
)
{
JPanel
jp
=
plugin
.
getPanel
();
JPanel
jp
=
plugin
.
getPanel
();
jp
.
setName
(
"plugin."
.
concat
(
plugin
.
getName
())
);
jp
.
setName
(
t
);
desktop
.
addTab
(
plugin
.
getDisplayName
(),
jp
);
desktop
.
addTab
(
plugin
.
getDisplayName
(),
jp
);
}
}
}
});
@Override
public
void
start
()
{
jFrame
.
pack
();
jFrame
.
pack
();
jFrame
.
setVisible
(
true
);
jFrame
.
setVisible
(
true
);
}
}
}
}
library/liblangbuilder/src/main/java/me/felinewith/lang_toolkit/library/ILangPlugin.java
View file @
54367d6
package
me
.
felinewith
.
lang_toolkit
.
library
;
package
me
.
felinewith
.
lang_toolkit
.
library
;
import
org.apache.commons.configuration2.Configuration
;
/**
/**
*
*
* @author jlhawkwell
* @author jlhawkwell
*/
*/
public
interface
ILangPlugin
{
public
abstract
class
ILangPlugin
{
protected
Configuration
project
;
public
abstract
int
hasFile
();
public
abstract
String
getFileName
();
}
}
library/libservices/src/main/java/me/felinewith/lang_toolkit/library/ILangService.java
View file @
54367d6
package
me
.
felinewith
.
lang_toolkit
.
library
;
package
me
.
felinewith
.
lang_toolkit
.
library
;
import
javax.swing.JComponent
;
import
javax.swing.JComponent
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
/**
/**
*
*
* @author jlhawkwell
* @author jlhawkwell
*/
*/
public
interface
ILangService
<
T
>
{
public
abstract
class
ILangService
<
T
>
{
public
abstract
void
serviceInit
();
protected
Logger
log
;
public
void
serviceInit
()
{
log
=
LogManager
.
getLogger
();
}
public
abstract
void
serviceInit
(
T
t
);
public
abstract
void
serviceInit
(
T
t
);
public
abstract
boolean
canAttach
();
public
abstract
boolean
canAttach
();
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment