Skip to content

Commit

Permalink
Make all CommonIcons a @JvmField (#379)
Browse files Browse the repository at this point in the history
  • Loading branch information
maartenba authored Oct 19, 2020
1 parent da04552 commit 87c9d57
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public void valueChangedFunc(ListSelectionEvent event) {
}
});

btnSearch.setIcon(CommonIcons.INSTANCE.getSearch());
btnSearch.setIcon(CommonIcons.Search);
btnSearch.addActionListener(new AzureActionListenerWrapper(INSIGHT_NAME, "btnSearch", null) {
@Override
public void actionPerformedFunc(ActionEvent event) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ private Long getValue(String strValue) {
sorter.setSortKeys(sortKeys);
sorter.sort();

backButton.setIcon(CommonIcons.INSTANCE.getOpenParent());
backButton.setIcon(CommonIcons.OpenParent);
backButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
Expand Down Expand Up @@ -287,37 +287,37 @@ public void actionPerformed(ActionEvent actionEvent) {
}
};

refreshButton.setIcon(CommonIcons.INSTANCE.getRefresh());
refreshButton.setIcon(CommonIcons.Refresh);
refreshButton.addActionListener(queryAction);

queryButton.setIcon(CommonIcons.INSTANCE.getSearch());
queryButton.setIcon(CommonIcons.Search);
queryButton.addActionListener(queryAction);

deleteButton.setIcon(CommonIcons.INSTANCE.getDiscard());
deleteButton.setIcon(CommonIcons.Discard);
deleteButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
fileEditorVirtualNode.getNodeActionByName(DELETE).fireNodeActionEvent();
}
});

saveAsButton.setIcon(CommonIcons.INSTANCE.getSaveChanges());
saveAsButton.setIcon(CommonIcons.SaveChanges);
saveAsButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
fileEditorVirtualNode.getNodeActionByName(SAVE_AS).fireNodeActionEvent();
}
});

openButton.setIcon(CommonIcons.INSTANCE.getOpen());
openButton.setIcon(CommonIcons.Open);
openButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
fileEditorVirtualNode.getNodeActionByName(OPEN).fireNodeActionEvent();
}
});

uploadButton.setIcon(CommonIcons.INSTANCE.getUpload());
uploadButton.setIcon(CommonIcons.Upload);
uploadButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,15 @@ public void keyReleased(KeyEvent keyEvent) {
}
});

refreshButton.setIcon(CommonIcons.INSTANCE.getRefresh());
refreshButton.setIcon(CommonIcons.Refresh);
refreshButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
fileEditorVirtualNode.getNodeActionByName(REFRESH).fireNodeActionEvent();
}
});

dequeueMessageButton.setIcon(CommonIcons.INSTANCE.getOpen());
dequeueMessageButton.setIcon(CommonIcons.Open);
dequeueMessageButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ public void actionPerformed(ActionEvent actionEvent) {
}
};

queryButton.setIcon(CommonIcons.INSTANCE.getSearch());
queryButton.setIcon(CommonIcons.Search);
queryButton.addActionListener(queryActionListener);

refreshButton.setIcon(CommonIcons.INSTANCE.getRefresh());
refreshButton.setIcon(CommonIcons.Refresh);
refreshButton.addActionListener(queryActionListener);

deleteButton.addActionListener(new ActionListener() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ public void actionPerformedFunc(ActionEvent event) {
setTextFieldStyle();

btnGetPublishFile.setIcon(AllIcons.Actions.Download);
btnSave.setIcon(CommonIcons.INSTANCE.getSaveChanges());
btnDiscard.setIcon(CommonIcons.INSTANCE.getDiscard());
btnSave.setIcon(CommonIcons.SaveChanges);
btnDiscard.setIcon(CommonIcons.Discard);
}

protected abstract String getId();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public SubscriptionStep(final VMWizardModel model, final Project project) {

model.configStepList(createVmStepsList, 0);

buttonLogin.setIcon(CommonIcons.INSTANCE.getSubscriptions());
buttonLogin.setIcon(CommonIcons.Subscriptions);

buttonLogin.addActionListener(new ActionListener() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,31 +29,31 @@ object CommonIcons {

@JvmField val Azure = load("Azure.svg")
@JvmField val AzureExplorer = load("AzureExplorer.svg")
val Subscriptions by lazy { load("Subscriptions.svg") }
val Database by lazy { load("Database.svg") }
val WebApp by lazy { load("WebApp.svg") }
val Firewall by lazy { load("Firewall.svg") }
@JvmField val Subscriptions = load("Subscriptions.svg")
@JvmField val Database = load("Database.svg")
@JvmField val WebApp = load("WebApp.svg")
@JvmField val Firewall = load("Firewall.svg")

val Warning by lazy { load("AzureWarning.svg") }
@JvmField val Warning = load("AzureWarning.svg")

val Search by lazy { load("Search.svg") }
val Refresh by lazy { load("refresh.svg") }
val OpenParent by lazy { load("AzureOpenParent.svg") }
val Discard by lazy { load("Discard.svg") }
val SaveChanges by lazy { load("SaveChanges.svg") }
val Open by lazy { load("AzureOpen.svg") }
val Upload by lazy { load("AzureUpload.svg") }
@JvmField val Search = load("Search.svg")
@JvmField val Refresh = load("refresh.svg")
@JvmField val OpenParent = load("AzureOpenParent.svg")
@JvmField val Discard = load("Discard.svg")
@JvmField val SaveChanges = load("SaveChanges.svg")
@JvmField val Open = load("AzureOpen.svg")
@JvmField val Upload = load("AzureUpload.svg")

@JvmField val PublishAzure = load("publishAzure.svg")
@JvmField val CodeSamples = load("CodeSamples.svg")

val Azurite by lazy { load("AzureStorageEmulator.svg") }
@JvmField val Azurite = load("AzureStorageEmulator.svg")

@JvmField val AzureActiveDirectory = load("AzureActiveDirectory.svg")

object OS {
val Windows by lazy { load("OSWindows.svg") }
val Linux by lazy { load("OSLinux.svg") }
@JvmField val Windows = load("OSWindows.svg")
@JvmField val Linux = load("OSLinux.svg")
}

object CloudShell {
Expand All @@ -67,17 +67,17 @@ object CommonIcons {
}

object AzureFunctions {
val FunctionApp by lazy { load("FunctionApp.svg") }
@JvmField val FunctionApp = load("FunctionApp.svg")
@JvmField val FunctionAppRunConfiguration = load("FunctionAppRunConfiguration.svg")
val FunctionAppConfigurationType by lazy { load("FunctionApp.svg") }
val TemplateAzureFunc by lazy { load("TemplateAzureFunc.svg") }
@JvmField val FunctionAppConfigurationType = load("FunctionApp.svg")
@JvmField val TemplateAzureFunc = load("TemplateAzureFunc.svg")
}

@Suppress("unused")
object ResourceManagement {
val ResourceManagement by lazy { load("AzureARM.svg") }
val ResourceGroup by lazy { load("AzureARMResourceGroup.svg") }
val Deployment by lazy { load("AzureARMDeployment.svg") }
@JvmField val ResourceManagement = load("AzureARM.svg")
@JvmField val ResourceGroup = load("AzureARMResourceGroup.svg")
@JvmField val Deployment = load("AzureARMDeployment.svg")
}

private fun load(path: String): Icon = IconLoader.getIcon("/icons/$path", this::class.java)
Expand Down

0 comments on commit 87c9d57

Please sign in to comment.