Skip to content

Commit

Permalink
more clean ups and code simplifications
Browse files Browse the repository at this point in the history
  • Loading branch information
aress31 committed Dec 26, 2023
1 parent 5e07803 commit 0fdc680
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 68 deletions.
2 changes: 1 addition & 1 deletion src/main/java/swurg/gui/MainTabGroup.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ private void initComponents() {
}

@Override
public void onRequestWithMetadatasUpdate() {
public void onMyHttpRequestsUpdate() {
if (indexOfComponent(this.parametersPanel) == -1 && !this.myHttpRequests.isEmpty()) {
removeTabAt(indexOfComponent(this.aboutPanel));
addTab("Parameters", this.parametersPanel);
Expand Down
57 changes: 0 additions & 57 deletions src/main/java/swurg/gui/components/CustomTextFieldEditor.java

This file was deleted.

8 changes: 3 additions & 5 deletions src/main/java/swurg/gui/components/FilterPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,19 @@ public FilterPanel(TableRowSorter<?> tableRowSorter) {

initComponents();

addFilterTextFieldListener();
addDocumentListener();
}

public void initComponents() {
JLabel westLabel = new JLabel("Filter (regex, case-sensitive):");

// Ensures JTextField size stability during resizing...
this.filterTextField.setMinimumSize(new Dimension(this.filterTextField.getPreferredSize()));

this.add(westLabel);
this.add(new JLabel("Filter (regex, case-sensitive):"));
this.add(this.filterTextField);
this.add(this.eastLabel);
}

private void addFilterTextFieldListener() {
private void addDocumentListener() {
this.filterTextField.getDocument().addDocumentListener(new DocumentListener() {
private void updateFilter() {
SwingUtilities.invokeLater(() -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void unregisterObserver(ParserTableModelObserver observer) {
// Add a method to notify the observers
private void notifyObservers() {
for (ParserTableModelObserver observer : observers)
observer.onRequestWithMetadatasUpdate();
observer.onMyHttpRequestsUpdate();

notifyParametersPanelObservers();
}
Expand All @@ -75,7 +75,7 @@ public void unregisterParametersPanelObserver(ParametersPanelObserver observer)

private void notifyParametersPanelObservers() {
for (ParametersPanelObserver observer : parametersPanelObservers)
observer.onRequestWithMetadatasUpdate();
observer.onMyHttpRequestsUpdate();
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/swurg/gui/views/ParametersPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public void componentShown(ComponentEvent e) {
}

@Override
public void onRequestWithMetadatasUpdate() {
public void onMyHttpRequestsUpdate() {
Set<MyHttpParameter> myHttpParameters = myHttpRequests.stream()
.flatMap(myHttpRequest -> myHttpRequest.getHttpRequest().parameters().stream()
.map(myHttpParameter -> MyHttpParameter.builder()
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/swurg/observers/ParametersPanelObserver.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package swurg.observers;

public interface ParametersPanelObserver {
void onRequestWithMetadatasUpdate();
void onMyHttpRequestsUpdate();
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package swurg.observers;

public interface ParserTableModelObserver {
void onRequestWithMetadatasUpdate();
void onMyHttpRequestsUpdate();
}

0 comments on commit 0fdc680

Please sign in to comment.