Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CPSC329-PM
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sean Kim
CPSC329-PM
Commits
4168e7c6
Commit
4168e7c6
authored
1 week ago
by
Syed OMAR
Browse files
Options
Downloads
Patches
Plain Diff
Edit Info window has all of its textfields connected to its respective controller
parent
1bf929ea
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#8361
canceled
1 week ago
Stage: build
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/com/cpsc329pm/EditInfoSceneController.java
+7
-3
7 additions, 3 deletions
src/main/java/com/cpsc329pm/EditInfoSceneController.java
src/main/resources/com/cpsc329pm/EditInfoScene.fxml
+2
-2
2 additions, 2 deletions
src/main/resources/com/cpsc329pm/EditInfoScene.fxml
with
9 additions
and
5 deletions
src/main/java/com/cpsc329pm/EditInfoSceneController.java
+
7
−
3
View file @
4168e7c6
...
...
@@ -24,6 +24,9 @@ public class EditInfoSceneController {
@FXML
private
TextField
serviceNameField
;
@FXML
private
TextField
usernameField
;
@FXML
private
TextField
editUsernameField
;
...
...
@@ -33,14 +36,15 @@ public class EditInfoSceneController {
@FXML
private
void
handleEdit
(
ActionEvent
event
)
{
String
platform
=
serviceNameField
.
getText
();
String
username
=
editUsernameField
.
getText
();
String
username
=
usernameField
.
getText
();
String
newUsername
=
editUsernameField
.
getText
();
String
newPassword
=
editPasswordField
.
getText
();
try
{
DataStorage
ds
=
new
DataStorage
(
"master_login.json"
);
// Check if the service exists in the JSON file
Data
existingData
=
ds
.
getData
(
platform
,
u
sername
);
Data
existingData
=
ds
.
getData
(
platform
,
newU
sername
);
if
(
existingData
==
null
)
{
// If the service doesn't exist, show error alert
Alert
alert
=
new
Alert
(
Alert
.
AlertType
.
ERROR
);
...
...
@@ -52,7 +56,7 @@ public class EditInfoSceneController {
}
// If the service exists, proceed with updating the data
ds
.
updateData
(
platform
,
u
sername
,
newPassword
);
ds
.
updateData
(
platform
,
newU
sername
,
newPassword
);
ds
.
saveToJSON
();
Alert
alert
=
new
Alert
(
Alert
.
AlertType
.
INFORMATION
);
...
...
This diff is collapsed.
Click to expand it.
src/main/resources/com/cpsc329pm/EditInfoScene.fxml
+
2
−
2
View file @
4168e7c6
...
...
@@ -12,7 +12,7 @@
<?import javafx.scene.paint.Stop?>
<?import javafx.scene.text.Font?>
<AnchorPane
prefHeight=
"600.0"
prefWidth=
"500.0"
xmlns=
"http://javafx.com/javafx/2
3.0.
1"
xmlns:fx=
"http://javafx.com/fxml/1"
fx:controller=
"com.cpsc329pm.EditInfoSceneController"
>
<AnchorPane
prefHeight=
"600.0"
prefWidth=
"500.0"
xmlns=
"http://javafx.com/javafx/21"
xmlns:fx=
"http://javafx.com/fxml/1"
fx:controller=
"com.cpsc329pm.EditInfoSceneController"
>
<children>
<AnchorPane
prefHeight=
"140.0"
prefWidth=
"600.0"
styleClass=
"backgroundColor"
stylesheets=
"@EditInfo.css"
>
<children>
...
...
@@ -100,7 +100,7 @@
</LinearGradient>
</textFill>
</Button>
<TextField
layoutX=
"55.0"
layoutY=
"312.0"
prefHeight=
"26.0"
prefWidth=
"477.0"
promptText=
"Username for Credential Changes"
/>
<TextField
fx:id=
"usernameField"
layoutX=
"55.0"
layoutY=
"312.0"
prefHeight=
"26.0"
prefWidth=
"477.0"
promptText=
"Username for Credential Changes"
/>
<Label
layoutX=
"81.0"
layoutY=
"292.0"
prefHeight=
"17.0"
prefWidth=
"194.0"
text=
"Username for Credential Changes"
/>
<ImageView
fitHeight=
"26.0"
fitWidth=
"30.0"
layoutX=
"59.0"
layoutY=
"286.0"
pickOnBounds=
"true"
preserveRatio=
"true"
>
<image>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment