-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding control panel section for Yatran
- First control panel section based on SimpleFormSection and RegistryProxy added
- Loading branch information
Michael Pozhidaev
committed
Dec 13, 2015
1 parent
987ab0e
commit 7a6dded
Showing
4 changed files
with
63 additions
and
2 deletions.
There are no files selected for viewing
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
30 changes: 30 additions & 0 deletions
30
yatran/src/main/java/org/luwrain/extensions/yatran/ControlPanelSection.java
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,30 @@ | ||
/* | ||
Copyright 2012-2015 Michael Pozhidaev <[email protected]> | ||
This file is part of the LUWRAIN. | ||
LUWRAIN is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU General Public | ||
License as published by the Free Software Foundation; either | ||
version 3 of the License, or (at your option) any later version. | ||
LUWRAIN is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
General Public License for more details. | ||
*/ | ||
|
||
package org.luwrain.extensions.yatran; | ||
|
||
import org.luwrain.core.*; | ||
import org.luwrain.cpanel.*; | ||
|
||
public class ControlPanelSection extends SimpleFormSection | ||
{ | ||
public ControlPanelSection(Registry registry) | ||
{ | ||
super("Яндекс.Переводчик", BasicSections.ROOT); | ||
final RegistryParams params = RegistryProxy.create(registry, "/org/luwrain/extensions/yatran", RegistryParams.class); | ||
addString("Ключ для доступа к сервису:", "", (name, value)->params.setKey(value)); | ||
} | ||
} |
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
23 changes: 23 additions & 0 deletions
23
yatran/src/main/java/org/luwrain/extensions/yatran/RegistryParams.java
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,23 @@ | ||
/* | ||
Copyright 2012-2015 Michael Pozhidaev <[email protected]> | ||
This file is part of the LUWRAIN. | ||
LUWRAIN is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU General Public | ||
License as published by the Free Software Foundation; either | ||
version 3 of the License, or (at your option) any later version. | ||
LUWRAIN is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
General Public License for more details. | ||
*/ | ||
|
||
package org.luwrain.extensions.yatran; | ||
|
||
interface RegistryParams | ||
{ | ||
String getKey(); | ||
void setKey(String value); | ||
} |