Eclipse RCP /Plugin移除Search对话框
RCP:如何移除Search对话框中不需要的项
2013-08-18 22:31 by Binhua Liu, 231 阅读, 0 评论, 收藏, 编辑
前言
很久没写文章了,准备写一系列关于Eclipse RCP /Plugin的文章。 这些文章都是trouble shooting性质的,不准备写的很细,当你碰到这样的问题,google到时,能帮你把问题解决了,这就ok了。另外有些问题我也是不求甚解的,哈。
正文
Search Dialog中可能出现一些你不需要的项,比如“Java Search”,这个项是org.eclipse.jdt.ui贡献的,如果你因为某些需要引用了这个包,比如我需要用到这个包中的org.eclipse.jdt.ui.action.MoveAction,用来在Project Explorer右键菜单添加Move。 那么“Java Search”就会被贡献到Search Dialog中,我们有两个办法去除这些不需要的项:
1,在plugin.xml中添加org.eclipse.ui.activities扩展点来过滤。我读过源代码,通过activities应该是可以生效的,但是我没有成功,可能还是匹配符不对。贴出我的代码,只供参考:
<extension
point="org.eclipse.ui.activities">
<activity
id="com.balabala.JavaSearchPage"
name="DisableJavaSearch"></activity>
<activityPatternBinding
activityId="com.balabalaactivityPatternBinding1"
isEqualityPattern="true"
pattern="org\.eclipse\.jdt\.ui/org\.eclipse\.jdt\.ui\.JavaSearchPage">
</activityPatternBinding>
</extension>
有兴趣的可以参考以下连接自己研究:
2,通过继承org.eclipse.search.internal.ui.SearchDialog来去除多余的项,重写createPageArea方法,把TabFolder中不需要的TabItem移除掉。
CustomSearchDialog.java:
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
protected Control createPageArea(Composite parent) { Control control = super.createPageArea(parent); Composite composite = (Composite)control; Control[] controls = composite.getChildren(); for(Control c: controls) { if(c instanceof TabFolder) { TabFolder tabFolder =(TabFolder)c; for(int i=tabFolder.getItemCount()-1;i>=0;i--) { TabItem item = tabFolder.getItem(i); if(!item.getText().equals("File Search")) { item.dispose(); } } } } return control; } |
然后,需要继承org.eclipse.search.internal.ui.OpenSearchDialogAction, 重写run方法:
CustomSearchDialogAction.java:
|
1
2
3
4
5
6
7
8
|
public void run() { if (workbenchWindow.getActivePage() == null) { SearchPlugin.beep(); return; } CustomSearchDialog dialog= new CustomSearchDialog(workbenchWindow, null); dialog.open();} |
最后在Menu和toolbar中调用CustomSearchDialogAction。
Redhat Server 5.7 安装配置PHP
2013-08-16 23:30 by 潇湘隐者, 248 阅读, 0 评论, 收藏, 编辑
PHP的简介
PHP于1994年由Rasmus Lerdorf创建,刚刚开始是Rasmus Lerdorf 为了要维护个人网页而制作的一个简单的用Perl语言编写的程序。这些工具程序用来显示 Rasmus Lerdorf 的个人履历,以及统计网页流量。后来又用C语言重新编写,包括可以访问数据库。他将这些程序和一些表单直译器整合起来,称为 PHP/FI。PHP/FI 可以和数据库连接,产生简单的动态网页程序.......[参考百科]
PHP的官方网址:http://www.php.net/
PHP安装配置
首先去官网http://cn2.php.net/downloads.php下载最新版的安装包或你需要的版本,本次实验的系统环境为Red Hat Enterprise Linux Server release 5.7 64bit。这篇文章是安装配置nagios的过程
- [root@getlnx05 kerry]# tar zxvf php-5.4.10.tar.gz
- [root@getlnx05 kerry]# cdphp-5.4.10
- [root@getlnx05 php-5.4.10]#./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs

报错详细信息:
报错“configure: error: xml2-config not found. Please check your libxml2 installation.”是因为缺少libxml2相关的包libxml2-devel, 如下所示,先检查已经安装了那些libxml2相关的包
- [root@getlnx05 php-5.4.10]# rpm -qa |greplibxml2
- libxml2-python-2.6.26-2.1.12
- libxml2-2.6.26-2.1.12
- libxml2-2.6.26-2.1.12

[root@getlnx05 php-5.4.10]# rpm -qa libxml2-devel
[root@getlnx05 php-5.4.10]# yum install libxml2-devel

[root@getlnx05 php-5.4.10]# ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs

[root@getlnx05 php-5.4.10]#make

[root@getlnx05 php-5.4.10]#make install

接下来配置Apache服务,关于Apache的安装,可以参考我的博客Linux系统安装Appach 2.4.6
PHP环境配置
Step 1: Apache环境配置
首先找到Apache的配置文件配置文件/usr/local/apache/conf/httpd.conf (我Apache服务安装目录为/usr/local/apache)
找到
#User daemon
#Group daemon
修改为
User nagios
Group nagios
另外找到ServerName www.example.com:80 ,在下面增加ServerName添加服务器的IP地址

另外找到下面配置,增加index.php
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>

接下来找到<IfModule mime_module>,在后面增加配置信息AddType application/x-httpd-php .php,如下所示

出于安全考虑,一般访问nagios的安全监控界面必须经过授权才能访问(不要那么,安装配置PHP是安装配置nagios的过程,如果大家只是为了安装配置PHP环境,完全可以跳过下面),这需要增加验证配置,即在httpd.conf 文件最后添加如下信息:

Step 2:创建apache目录验证文件
[root@getlnx05 conf]# /usr/local/apache/bin/htpasswd -c /usr/local/nagios/etc/htpasswd kerry

这样就在/usr/local/nagios/etc 目录下创建了一个htpasswd 验证文件,当通过http://192.168.xx.xxx/nagios/访问时就需要输入用户名和密码了。当然验证文件的密码是加密过的,如下所示:
[root@getlnx05 conf]# cat /usr/local/nagios/etc/htpasswd
kerry:$apr1$H1bHFvhH$q.bsSARuh4Ns2Z5G9hmQN.
[root@getlnx05 conf]#

Step 3:重启Apache服务
[root@getlnx05 conf]# /usr/local/apache/bin/apachectl restart
AH00526: Syntax error on line 515 of /usr/local/apache/conf/httpd.conf:
AuthUserFile takes one argument, text file containing user IDs and passwords
[root@getlnx05 conf]#
用vi打开/usr/local/apache/conf/httpd.conf文件,定位到515行(下面红色的哪一行),后面的哪一行汉字注释变成导致,如下图所示:
- #setting for nagios
- ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"
- <Directory "/usr/local/nagios/sbin">
- AuthType Basic
- Options ExecCGI
- AllowOverride None
- Order allow,deny
- Allow from all
- AuthName "Nagios Access"
- AuthUserFile /usr/local/nagios/etc/htpasswd //用于此目录访问身份验证的文件
- Require valid-user
- </Directory>
- Alias /nagios "/usr/local/nagios/share"
- <Directory "/usr/local/nagios/share">
- AuthType Basic
- Options None
- AllowOverride None
- Order allow,deny
- Allow from all
- AuthName "nagios Access"
- AuthUserFile /usr/local/nagios/etc/htpasswd
- Require valid-user
- </Directory>

将这一行注释清除后,重启Apache服务,OK,问题解决,打开http://192.168.7.223/nagios/进入网站,点击其它页面发现乱码,这是因为Apache没有开启cgi脚本的缘故。进入apache的主配置文件httpd.conf将#LoadModule cgid_module modules/mod_cgid.so前的注释符号去掉,重启Apache服务即可解决问题


参考资料:
http://www.cnblogs.com/mchina/archive/2013/02/20/2883404.html
Eclipse RCP /Plugin移除Search对话框的更多相关文章
- RCP:如何移除Search对话框中不需要的项
前言 很久没写文章了,准备写一系列关于Eclipse RCP /Plugin的文章. 这些文章都是trouble shooting性质的,不准备写的很细,当你碰到这样的问题,google到时,能帮你把 ...
- Eclipse RCP 中创建自己定义首选项,并能读取首选项中的值
Eclipse RCP的插件中若想自定义首选项须要扩展扩展点: org.eclipse.core.runtime.preferences //该扩展点用于初始化首选项中的值 org.eclipse.u ...
- 可视化(番外篇)——在Eclipse RCP中玩转OpenGL
最近在看有关Eclipse RCP方面的东西,鉴于Gephi是使用opengl作为绘图引擎,所以,萌生了在Eclipse RCP下添加画布,使用opengl绘图的想法,网上有博文详细介绍这方面的内容, ...
- Eclipse - FindBugs Plugin 的安装和使用
Eclipse - FindBugs Plugin 的安装和使用 FindBugs is a static analysis tool that examines the classes in se ...
- Eclipse RCP学习资料
1.拥抱Eclipse RCP http://www.blogjava.net/youxia/category/17374.html 2.RCP工程下面自动生成了如下文件:Application.ja ...
- Eclipse RCP应用开发(概念)
学习Eclipse RCP应用开发,对其中一些相关的概念需要了解. 让我们在讲解概念前先思考两个问题. 问题一.什么是Eclipse 大部分同学会回答eclipse是IBM公司开发的java集成开发环 ...
- Eclipse RCP:多平台部署
1 问题 在使用Eclipse RCP IDE进行开发时,它自带的PDE(插件开发环境)工具仅能够导出相同平台的部署包,比如win32的仅能导出win32的,linux64仅能够导出linux64的. ...
- Eclipse org.eclipse.compare plug-in
Plug-in metedata tell eclipse runtime kernel how to create a expected object and set its perperties, ...
- Eclipse RCP难点:给Command传递参数(Object)
这个问题网络上没有答案,国外网站上也没有,本人研究了一天,终于搞明白如何实现,实际上是Eclipse RCP的ICommandService本身就已经提供的方法,只是网络上教的都是使用IHandler ...
随机推荐
- hdu 1002 Java 大数 加法
http://acm.hdu.edu.cn/showproblem.php?pid=1002 PE 由于最后一个CASE不须要输出空行 import java.math.BigInteger; i ...
- 【百度地图API】自行获取区域经纬度的工具
原文:[百度地图API]自行获取区域经纬度的工具 摘要:上一章教大家如何建立自己的行政区域地图.这次为大家提供一个,可视化选择区域,并且能自动生成经纬度代码的工具.工具的源代码完全公开,并且做了详尽的 ...
- NDMCDB数据库hang住故障分析 - cursor: pin S wait on X
问题描写叙述: 上午刚刚到办公室,就有监控人员邮件反馈,昨晚NDMCDB407数据库被重新启动过,让我分析一下数据库重新启动的原因.因为昨晚业务有版本号上线,所以短信警告关闭了,所以没有短信下发到我手 ...
- win7安装ruby on rails开发环境
前言 我们看到很多文章说ruby环境windows它是非常困难的基础上,这将是各种稀奇古怪的问题,因此,建议linux和mac发. 可是我依照教程搭了下,问题也不算太多.总过大概花费了2个半小时左右就 ...
- Uva 409-Excuses, Excuses!(串)
Judge Ito is having a problem with people subpoenaed for jury duty giving rather lame excuses in ord ...
- 【Unity 3D】学习笔记四十一:关节
关节 关节组件能够加入至多个游戏对象中,而加入关节的游戏对象将通过关节连接在一起而且感觉连带的物理效果.须要注意的是:关节必须依赖于刚体组件. 关节介绍 关节一共分为5大类:链条关节,固定关节,弹簧关 ...
- STM32W芯片的JTAG口用于GPIO
使用过程中发现STM32W芯片在驱动液晶SPI液晶时,在调试状态下可以正常工作但在通常运行情况下却没有任何显示! 经查发现我使用的两个端口PC0和PC3的电平很不正常,拉不高. 所以我就怀疑到IO口问 ...
- 1001 - Another A+B
1001 - Another A+B Description Give you an integer a, you are to find two another integers which sum ...
- IQueryable与IQEnumberable的区别
IEnumberable接口: 公开枚举器,该枚举器支持在指定类型的集合上进行简单迭代.也就是说:实现了此接口的object,就可以直接使用froeach遍历此object; IQueryable接口 ...
- Oracle表介绍--簇表
簇和簇表 簇其实就是一组表,是一组共享相同数据块的多个表组成. 将经常一起使用的表组合在一起成簇可以提高处理效率. 在一个簇中的表就叫做簇表.建立顺序是:簇→簇表→数据→簇索引 ...