Skip to content

Commit

Permalink
Move the CSV importer menu item in File > Import
Browse files Browse the repository at this point in the history
  • Loading branch information
tinevez committed Oct 9, 2024
1 parent 698d98b commit 2c482b5
Showing 1 changed file with 6 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,15 @@
*/
package org.mastodon.mamut.io.csv.plugin;

import static org.mastodon.app.ui.ViewMenuBuilder.item;
import static org.mastodon.app.ui.ViewMenuBuilder.menu;

import java.awt.BorderLayout;
import java.awt.Frame;
import java.awt.Image;
import java.awt.event.ActionEvent;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand All @@ -59,8 +63,6 @@
public class CSVImporterPlugin implements MamutPlugin
{

public static final String[] MENU_PATH = new String[] { "Plugins", "Imports" };

public static final String SHOW_CSV_IMPORTER_DIALOG_ACTION = "show csv importer dialog";

private static final String[] ACTION_1_KEYS = new String[] { "not mapped" };
Expand All @@ -83,7 +85,8 @@ public Map< String, String > getMenuTexts()
@Override
public List< MenuItem > getMenuItems()
{
return Arrays.asList( makeFullMenuItem( MamutMenuBuilder.item( SHOW_CSV_IMPORTER_DIALOG_ACTION ) ) );
return Collections.singletonList(
MamutMenuBuilder.fileMenu( menu( "Import", item( SHOW_CSV_IMPORTER_DIALOG_ACTION ) ) ) );
}

@Override
Expand All @@ -98,14 +101,6 @@ public void setAppPluginModel( final ProjectModel appModel )
toggleImporterDialog.setModel( appModel.getModel() );
}

private static final MenuItem makeFullMenuItem( final MenuItem item )
{
MenuItem menuPath = item;
for ( int i = MENU_PATH.length - 1; i >= 0; i-- )
menuPath = MamutMenuBuilder.menu( MENU_PATH[ i ], menuPath );
return menuPath;
}

/**
* Command descriptions for all provided commands
*/
Expand Down

0 comments on commit 2c482b5

Please sign in to comment.