Skip to content

Commit

Permalink
Added Function Deployment Settings
Browse files Browse the repository at this point in the history
  • Loading branch information
teetangh committed Jun 9, 2023
1 parent c9e88a0 commit 7aac1ac
Show file tree
Hide file tree
Showing 4 changed files with 1,080 additions and 32 deletions.
31 changes: 31 additions & 0 deletions src/main/java/com/couchbase/intellij/eventing/CustomComboBox.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package com.couchbase.intellij.eventing;

import javax.swing.*;
import java.awt.*;

class CustomComboBox extends JComboBox<String> {
public CustomComboBox() {
setRenderer(new DefaultListCellRenderer() {
@Override
public Component getListCellRendererComponent(JList<?> list, Object value, int index,
boolean isSelected,
boolean cellHasFocus) {
JLabel label = (JLabel) super.getListCellRendererComponent(list, value, index,
isSelected,
cellHasFocus);
if (index == 0) {
label.setForeground(Color.GRAY);
}
return label;
}
});
}

@Override
public void setPopupVisible(boolean v) {
if (v && getSelectedIndex() == 0) {
return;
}
super.setPopupVisible(v);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,9 @@

// if it is constant alias, the first line is constant alias(the dropdown menu itself) and two textfields containing placeholder texts of “Username..” and “password…” Respectively.
// }
package com.couchbase.intellij.tree;
package com.couchbase.intellij.eventing;

import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.GridBagConstraints;
Expand All @@ -125,13 +124,11 @@
import java.awt.event.MouseEvent;
import java.util.Set;

import javax.swing.DefaultListCellRenderer;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
Expand Down Expand Up @@ -1018,30 +1015,3 @@ public String getFunctionName() {
return functionNameField.getText();
}
}

class CustomComboBox extends JComboBox<String> {
public CustomComboBox() {
setRenderer(new DefaultListCellRenderer() {
@Override
public Component getListCellRendererComponent(JList<?> list, Object value, int index,
boolean isSelected,
boolean cellHasFocus) {
JLabel label = (JLabel) super.getListCellRendererComponent(list, value, index,
isSelected,
cellHasFocus);
if (index == 0) {
label.setForeground(Color.GRAY);
}
return label;
}
});
}

@Override
public void setPopupVisible(boolean v) {
if (v && getSelectedIndex() == 0) {
return;
}
super.setPopupVisible(v);
}
}
Loading

0 comments on commit 7aac1ac

Please sign in to comment.