Eclipse Terminate上下文菜单条目显示为灰色

时间:2019-07-12 12:50:35

标签: java eclipse

在询问之前-我已经检查了类似的问题,但到目前为止仍无法实现我的目标。我的麻烦是由于CTRL + F2在Eclipse中无法使用造成的。因此,我花了一些时间在这里查找快捷方式设置并测试了解决方案

What is the short cut in eclipse to terminate debugging/running?

或这里

Eclipse Terminate Keyboard Shortcut

但这似乎都不起作用。

现在我已经找到了原因,所以这是一个问题:

即使启动了Java应用程序,为什么我的上下文菜单运行>终止显示为灰色?

我正在采取的步骤是:

1)ALT + R打开运行上下文菜单

2)N打开运行配置

3)ALT + R运行我的配置

4)应用程序按预期启动

5)现在,我切换回Eclipse并再次按ALT + R-在应用程序运行时,终止显示为灰色。

那是为什么?

注意:

这是终止快捷方式无法正常工作的原因,因为此上下文菜单项将使用相应的快捷方式进行注释,只要该菜单项显示为灰色,就不会发生任何事情。

我也在 Debug 视角。

按红色的矩形矩形 Stop UI元素仍然会杀死该应用程序。在运行中,上下文菜单条目始终保持为灰色。为什么这两个人甚至映射到不同的事物?

预先感谢您的任何见解。

2 个答案:

答案 0 :(得分:0)

只有在“调试”视图中选择了应用程序后,该选项才启用。

答案 1 :(得分:0)

在@ greg-449的帮助下,我得以实现自己想要的。

现在的设置如下:

在Eclipse中,打开窗口>首选项>常规>键>显示视图(调试),按照以下建议将快捷方式设置为drop table lend_current; drop table lend_history; drop table books; create table books ( id int(11) PRIMARY KEY NOT NULL AUTO_INCREMENT); create table lend_history ( id int(11) PRIMARY KEY NOT NULL AUTO_INCREMENT, book_id int(11) NOT NULL, lender_name VARCHAR(50) NOT NULL, CONSTRAINT FK_books FOREIGN KEY(book_id) REFERENCES books(id)); create table lend_current ( lend_history_id int(11) PRIMARY KEY NOT NULL, CONSTRAINT FK_lendhistory FOREIGN KEY(lend_history_id) REFERENCES lend_history(id)); INSERT INTO books (id) VALUE(1); INSERT INTO books (id) VALUE(2); INSERT INTO lend_history (id, book_id, lender_name) VALUES(1, 1, "mike"); INSERT INTO lend_history (id, book_id, lender_name) VALUES(2, 2, "jane"); INSERT INTO lend_history (id, book_id, lender_name) VALUES(3, 2, "ola"); /* this will be current lender */ INSERT INTO lend_current (lend_history_id) VALUES(3); SELECT books.id, lend_history.lender_name FROM books LEFT JOIN lend_history on lend_history.book_id=books.id LEFT JOIN lend_current on lend_current.lend_history_id=lend_history.id + ALT + SHIFT我链接的资源。将绑定设置为在Windows中

现在,启动后可以按新设置的快捷方式打开调试,然后 Terminate 上下文菜单将变为可用,即使显然无法调用 Terminate all 就是UI元素的作用。

总而言之,它很复杂,但至少可以起作用。但是,对我来说,被迫管理发射仍然是荒谬的。