本文整理汇总了Java中javax.swing.JMenu.setText方法的典型用法代码示例。如果您正苦于以下问题:Java JMenu.setText方法的具体用法?Java JMenu.setText怎么用?Java JMenu.setText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JMenu
的用法示例。
在下文中一共展示了JMenu.setText方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: PopuleBarra
import javax.swing.JMenu; //导入方法依赖的package包/类
public void PopuleBarra(JMenu obj) {
int i = 0;
for (ConfigAcao ca : Lista) {
if (ca.tipo == TipoConfigAcao.tpMenuBarra || ca.tipo == TipoConfigAcao.tpAny) {
Acao ac = new Acao(editor, ca.texto, ca.ico, ca.descricao, ca.command);
ac.IDX = i++;
JMenuItem mi = new JMenuItem(ac);
//obj.add(mi);
listaMenus.put(ca.command, mi);
//ListaDeAcoes.add(ac);
}
}
obj.setText(Editor.fromConfiguracao.getValor("Controler.interface.menu.menuDiagrama.texto"));
char b = Editor.fromConfiguracao.getValor("Controler.interface.menu.menuDiagrama.mtecla").charAt(0);
obj.setMnemonic(b);
BarraMenu = obj;
}
示例2: createJdkSubmenu
import javax.swing.JMenu; //导入方法依赖的package包/类
@Messages("ActionMappings.jdkVar=Use JDK for Maven build")
private static JMenu createJdkSubmenu(JTextComponent area) {
JMenu menu = new JMenu();
menu.setText(ActionMappings_jdkVar());
boolean hasAny = false;
for (JavaPlatform platform : JavaPlatformManager.getDefault().getInstalledPlatforms()) {
hasAny = true;
if (platform.getInstallFolders().size() > 0) {
menu.add(new JdkAction(area, platform.getDisplayName(), platform.getInstallFolders().iterator().next()));
}
}
if (!hasAny) {
menu.setEnabled(false);
}
return menu;
}
示例3: getPopupPresenter
import javax.swing.JMenu; //导入方法依赖的package包/类
@Override
public JMenuItem getPopupPresenter() {
JMenu menu = createMenu();
menu.setText(Bundle.CTL_MenuItem_IgnoreMenu_popupName());
enableMenu(menu);
return menu;
}
示例4: createExploreMenu
import javax.swing.JMenu; //导入方法依赖的package包/类
/**
* Creates and returns an exploration menu for the menu bar.
*/
private JMenu createExploreMenu() {
JMenu result = new JMenu();
result.setMnemonic(Options.EXPLORE_MENU_MNEMONIC);
result.setText(Options.EXPLORE_MENU_NAME);
result.add(getActions().getExplorationDialogAction());
result.addSeparator();
result.add(getActions().getStartSimulationAction());
result.add(getActions().getApplyMatchAction());
result.add(getActions().getAnimateAction());
result.add(getActions().getExploreAction());
result.addSeparator();
result.add(getActions().getBackAction());
result.add(getActions().getForwardAction());
result.add(getActions().getGotoStartStateAction());
result.add(getActions().getGotoFinalStateAction());
result.addSeparator();
result.add(getActions().getSaveLTSAsAction());
result.addSeparator();
result.add(getActions().getExplorationStatsDialogAction());
return result;
}
示例5: initializeMenus
import javax.swing.JMenu; //导入方法依赖的package包/类
private void initializeMenus () {
{
JMenuBar menuBar = new JMenuBar();
setJMenuBar(menuBar);
{
JMenu fileMenu = new JMenu();
menuBar.add(fileMenu);
fileMenu.setText("File");
fileMenu.setMnemonic(KeyEvent.VK_F);
{
openMenuItem = new JMenuItem("Open Hiero settings file...");
openMenuItem.setMnemonic(KeyEvent.VK_O);
openMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, KeyEvent.CTRL_MASK));
fileMenu.add(openMenuItem);
}
{
saveMenuItem = new JMenuItem("Save Hiero settings file...");
saveMenuItem.setMnemonic(KeyEvent.VK_S);
saveMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, KeyEvent.CTRL_MASK));
fileMenu.add(saveMenuItem);
}
fileMenu.addSeparator();
{
saveBMFontMenuItem = new JMenuItem("Save BMFont files (text)...");
saveBMFontMenuItem.setMnemonic(KeyEvent.VK_B);
saveBMFontMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_B, KeyEvent.CTRL_MASK));
fileMenu.add(saveBMFontMenuItem);
}
fileMenu.addSeparator();
{
exitMenuItem = new JMenuItem("Exit");
exitMenuItem.setMnemonic(KeyEvent.VK_X);
fileMenu.add(exitMenuItem);
}
}
}
}
示例6: createGlobalVarSubmenu
import javax.swing.JMenu; //导入方法依赖的package包/类
@Messages("ActionMappings.globalVar=Reference IDE Global Variable")
private static JMenu createGlobalVarSubmenu(JTextComponent area) {
JMenu menu = new JMenu();
menu.setText(ActionMappings_globalVar());
Map<String, String> vars = DefaultReplaceTokenProvider.readVariables();
boolean hasAny = false;
for (Map.Entry<String, String> ent : vars.entrySet()) {
hasAny = true;
menu.add(new UseGlobalVarAction(area, ent.getKey()));
}
if (!hasAny) {
menu.setEnabled(false);
}
return menu;
}
示例7: createFileSelectionSubmenu
import javax.swing.JMenu; //导入方法依赖的package包/类
@Messages("ActionMappings.fileExpressions=IDE Selection Expressions")
private static JMenu createFileSelectionSubmenu(JTextComponent area) {
JMenu menu = new JMenu();
menu.setText(ActionMappings_fileExpressions());
menu.add(new FileVariableAction(area, "packageClassName"));
menu.add(new FileVariableAction(area, "className"));
menu.add(new FileVariableAction(area, "classNameWithExtension"));
menu.add(new FileVariableAction(area, "webPagePath"));
menu.add(new FileVariableAction(area, "classPathScope"));
menu.add(new FileVariableAction(area, "absolutePathName"));
return menu;
}
示例8: getPopupPresenter
import javax.swing.JMenu; //导入方法依赖的package包/类
@Override
@Messages({"ACT_Show=Show in POM",
"# {0} - artifactid of a project",
"ACT_Current=Current: {0}",
"# {0} - artifactid of a project",
"ACT_PARENT=Parent: {0}"})
public JMenuItem getPopupPresenter() {
JMenu menu = new JMenu();
menu.setText(ACT_Show());
POMCutHolder pch = node.getLookup().lookup(POMCutHolder.class);
POMModel[] mdls = pch.getSource();
Object[] val = pch.getCutValues();
int index = 0;
for (POMModel mdl : mdls) {
String artifact = mdl.getProject().getArtifactId();
JMenuItem item = new JMenuItem();
item.setAction(new SelectAction(node, index));
if (index == 0) {
item.setText(ACT_Current(artifact != null ? artifact : "project"));
} else {
item.setText(ACT_PARENT(artifact != null ? artifact : "project"));
}
item.setEnabled(/* #199345 */index < val.length && val[index] != null);
menu.add(item);
index++;
}
return menu;
}
示例9: createMenu
import javax.swing.JMenu; //导入方法依赖的package包/类
public JMenu createMenu (String containerContext) {
System.err.println("Creating a menu: " + containerContext);
JMenu result = new JMenu();
result.putClientProperty (KEY_CONTAINERCONTEXT, containerContext);
result.setName(containerContext);
result.setText (getEngine().getContainerProvider().getDisplayName(
ContainerProvider.TYPE_MENU, containerContext));
populateMenu(containerContext, result); //XXX listener should do this
attachToMenu(result);
return result;
}
示例10: getPopupPresenter
import javax.swing.JMenu; //导入方法依赖的package包/类
@Override
public JMenuItem getPopupPresenter() {
JMenu menu = createMenu();
menu.setText(Bundle.CTL_MenuItem_PatchesMenu_popupName());
enableMenu(menu);
return menu;
}
示例11: getPopupPresenter
import javax.swing.JMenu; //导入方法依赖的package包/类
@Override
public JMenuItem getPopupPresenter() {
JMenu menu = createMenu();
menu.setText(Bundle.CTL_MenuItem_RemoteMenu_popupName());
enableMenu(menu);
return menu;
}
示例12: getMenuPresenter
import javax.swing.JMenu; //导入方法依赖的package包/类
@Override
public JMenuItem getMenuPresenter () {
JMenu menu = createMenu();
menu.setText(Bundle.CTL_MenuItem_DiffMenu_Popup());
enableMenu(menu);
return menu;
}
示例13: getPopupPresenter
import javax.swing.JMenu; //导入方法依赖的package包/类
@Override
public JMenuItem getPopupPresenter() {
JMenu menu = createMenu();
menu.setText(Bundle.CTL_MenuItem_ConflictsMenu_popupName());
enableMenu(menu);
return menu;
}
示例14: getPopupPresenter
import javax.swing.JMenu; //导入方法依赖的package包/类
@Override
public JMenuItem getPopupPresenter() {
JMenu menu = createMenu();
menu.setText(Bundle.CTL_MenuItem_BranchMenu_popupName());
enableMenu(menu);
return menu;
}
示例15: getPopupPresenter
import javax.swing.JMenu; //导入方法依赖的package包/类
@Override
public JMenuItem getPopupPresenter() {
JMenu menu = createMenu();
menu.setText(Bundle.CTL_MenuItem_QueuesMenu_popupName());
enableMenu(menu);
return menu;
}