Skip to content

Commit 6d0f4e6

Browse files
committed
Add UXCustomTextField and UXPasswordTextField
Now components available in DevelNext editor
1 parent c3a9609 commit 6d0f4e6

33 files changed

+812
-12
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@
1414
/gradlew
1515
/gradlew.bat
1616
/package-lock.php.yml
17-
/out/**
17+
/out/**
18+
/dn-sources/**

package.php.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: jphp-controlsfx-ext
2-
version: 1.0.0
2+
version: 1.0.3
33

44
plugins:
55
- Hub
@@ -29,14 +29,15 @@ config:
2929
- /bundle/**
3030
- /src-bundle/**
3131
- /build
32-
- /jars/**
3332
- /out/**
33+
- /examples/**
34+
- /dn-sources/**
3435

3536
develnext-bundle:
36-
version: 1.0.0
37+
version: 1.0.4
3738
name: ControlsFX
3839
author: broelik
3940
icon: "develnext/bundle/controlsfx/icon32.png"
40-
description: "Пакет для работы с графиками"
41-
group: "network"
41+
description: "Пакет добавляет новые компоненты JavaFX"
42+
group: "other"
4243
class: "develnext\\bundle\\controlsfx\\ControlsFXBundle"
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
4+
namespace php\gui\controlsfx;
5+
6+
use php\gui\UXNode;
7+
use php\gui\UXPasswordField;
8+
9+
10+
class UXCustomPasswordField extends UXPasswordField
11+
{
12+
/**
13+
* @var UXNode
14+
*/
15+
public $left;
16+
/**
17+
* @var UXNode
18+
*/
19+
public $right;
20+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
4+
namespace php\gui\controlsfx;
5+
6+
7+
use php\gui\UXNode;
8+
use php\gui\UXTextField;
9+
10+
class UXCustomTextField extends UXTextField
11+
{
12+
/**
13+
* @var UXNode
14+
*/
15+
public $left;
16+
/**
17+
* @var UXNode
18+
*/
19+
public $right;
20+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22
namespace php\gui\controlsfx;
33

4-
use php\gui\UXIndexedCell;
4+
use php\gui\UXCell;
55

6-
class UXGridCell extends UXIndexedCell{
6+
class UXGridCell extends UXCell{
77

88
}
422 Bytes
Loading
796 Bytes
Loading
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
develnext\bundle\controlsfx\formats\elements\ToggleSwitchFormElement
2+
develnext\bundle\controlsfx\formats\elements\PlusMinusSliderFormElement
3+
develnext\bundle\controlsfx\formats\elements\RangeSliderFormElement
4+
develnext\bundle\controlsfx\formats\elements\CustomTextFieldFormElement
5+
develnext\bundle\controlsfx\formats\elements\CustomPasswordFieldFormElement
6+
develnext\bundle\controlsfx\formats\elements\RatingFormElement
7+
8+
develnext\bundle\controlsfx\formats\tags\ToggleSwitchFormElementTag
9+
develnext\bundle\controlsfx\formats\tags\PlusMinusSliderFormElementTag
10+
develnext\bundle\controlsfx\formats\tags\RangeSliderFormElementTag
11+
develnext\bundle\controlsfx\formats\tags\CustomTextFieldFormElementTag
12+
develnext\bundle\controlsfx\formats\tags\CustomPasswordFieldFormElementTag
13+
develnext\bundle\controlsfx\formats\tags\RatingFormElementTag

src-bundle/develnext/bundle/controlsfx/ControlsFXBundle.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,42 @@
22

33
namespace develnext\bundle\controlsfx;
44

5+
use ide\bundle\AbstractBundle;
56
use ide\bundle\AbstractJarBundle;
7+
use ide\formats\GuiFormFormat;
8+
use ide\Ide;
9+
use ide\library\IdeLibraryBundleResource;
10+
use ide\project\Project;
11+
use php\desktop\Runtime;
12+
use php\io\File;
13+
use php\lib\fs;
614

715
class ControlsFXBundle extends AbstractJarBundle
816
{
17+
function onAdd(Project $project, AbstractBundle $owner = null){
18+
parent::onAdd($project, $owner);
919

20+
/** @var GuiFormFormat $format */
21+
$format = Ide::get()->getRegisteredFormat(GuiFormFormat::class);
22+
if($format){
23+
$format->registerInternalList('.dn/bundle/controlsfx/formComponents');
24+
}
25+
}
26+
function onRemove(Project $project, AbstractBundle $owner = null){
27+
parent::onRemove($project, $owner);
28+
29+
/** @var GuiFormFormat $format */
30+
$format = Ide::get()->getRegisteredFormat(GuiFormFormat::class);
31+
if($format){
32+
$format->unregisterInternalList('.dn/bundle/controlsfx/formComponents');
33+
}
34+
}
35+
36+
public function onRegister(IdeLibraryBundleResource $resource)
37+
{
38+
parent::onRegister($resource);
39+
fs::scan($resource->getPath(), function(File $file){
40+
Runtime::addJar($file);
41+
});
42+
}
1043
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?php
2+
3+
4+
namespace develnext\bundle\controlsfx\formats\elements;
5+
6+
7+
use ide\formats\form\elements\LabeledFormElement;
8+
use ide\formats\form\elements\TextFieldFormElement;
9+
use ide\Ide;
10+
use ide\systems\Cache;
11+
use php\gui\controlsfx\UXCustomPasswordField;
12+
use php\gui\controlsfx\UXCustomTextField;
13+
use php\gui\controlsfx\UXToggleSwitch;
14+
use php\gui\event\UXDragEvent;
15+
use php\gui\framework\DataUtils;
16+
use php\gui\UXDragboard;
17+
use php\gui\UXImageView;
18+
use php\gui\UXLabeled;
19+
use php\gui\UXNode;
20+
use php\lib\fs;
21+
22+
class CustomPasswordFieldFormElement extends CustomTextFieldFormElement
23+
{
24+
public function getName(){
25+
return 'Расширенное поле для пароля';
26+
}
27+
28+
public function getElementClass(){
29+
return UXCustomPasswordField::class;
30+
}
31+
32+
public function isOrigin($any){
33+
return $any instanceof UXCustomPasswordField;
34+
}
35+
36+
public function getIcon(){
37+
return 'icons/passwordField16.png';
38+
}
39+
40+
public function getIdPattern(){
41+
return 'passwordField%s';
42+
}
43+
44+
45+
// public function getIdPattern(){
46+
// return 'edit%s';
47+
// }
48+
49+
/**
50+
* @return UXNode
51+
*/
52+
public function createElement(){
53+
return new UXCustomPasswordField();
54+
}
55+
}

0 commit comments

Comments
 (0)