以上就是给各位分享rails3.1.0ActionView::Template::Error,其中也会对application.css未预编译进行解释,同时本文还将给你拓展android–Applic
以上就是给各位分享rails 3.1.0 ActionView::Template::Error,其中也会对application.css 未预编译进行解释,同时本文还将给你拓展android – ApplicationStatus类E / SysUtils:ApplicationStat中的ApplicationContext为null、Application application_1512618719369_147804 failed 2 times due to ApplicationMaster for attempt app、ApplicationFilterFactory与ApplicationFilterChain-tomcat6.x源码阅读、com.intellij.openapi.application.ApplicationActivationListener的实例源码等相关知识,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!
本文目录一览:- rails 3.1.0 ActionView::Template::Error(application.css 未预编译)(未预编译文件,因此不能请求该文件)
- android – ApplicationStatus类E / SysUtils:ApplicationStat中的ApplicationContext为null
- Application application_1512618719369_147804 failed 2 times due to ApplicationMaster for attempt app
- ApplicationFilterFactory与ApplicationFilterChain-tomcat6.x源码阅读
- com.intellij.openapi.application.ApplicationActivationListener的实例源码
rails 3.1.0 ActionView::Template::Error(application.css 未预编译)(未预编译文件,因此不能请求该文件)
我用一个带有索引功能的简单页面控制器制作了一个基本的 Rails 应用程序,当我加载页面时,我得到:
ActionView::Template::Error (application.css isn't precompiled):
2: <html>
3: <head>
4: <title>Demo</title>
5: <%= stylesheet_link_tag "application" %>
6: <%= javascript_include_tag "application" %>
7: <%= csrf_meta_tags %>
8: </head>
app/views/layouts/application.html.erb:5:in `_app_views_layouts_application_html_erb__43625033_88530400'
宝石文件
source 'http://rubygems.org'
gem 'rails','3.1.0'
# Bundle edge Rails instead:
# gem 'rails',:git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
gem 'execjs'
gem 'therubyracer'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails'," ~> 3.1.0"
gem 'coffee-rails',"~> 3.1.0"
gem 'uglifier'
end
gem 'jquery-rails'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'ruby-debug19',:require => 'ruby-debug'
group :test do
# Pretty printed test output
gem 'turn',:require => false
end
android – ApplicationStatus类E / SysUtils:ApplicationStat中的ApplicationContext为null
E / SysUtils:ApplicationStat中的ApplicationContext为null
有谁知道ApplicationStatus类?我没有在我的项目中
它发生在我在openGL中快速渲染纹理时
解决方法
我的问题是在打开新意图时直接传递额外的变量,如下所示.
>调用代码:
intent.putExtra("markerdata: ",assetVO);
>接收代码:
markerdata = (HashMap<String,Object>) getIntent().getSerializableExtra("markerdata");
2天前升级到Android Studio 1.3后,我总是变为空.
所以我的工作是将传递的信息捆绑在一起:
>调用代码:
Bundle b = new Bundle(); b.putSerializable("markerdata",assetVO); intent.putExtras(b);
>接收代码:
Bundle extras = getIntent().getExtras(); markerdata = (HashMap<String,Object>) extras.getSerializable("markerdata");
现在它的工作原理.希望它可以帮助别人.
Application application_1512618719369_147804 failed 2 times due to ApplicationMaster for attempt app
今天遇到一个特别怪的问题,之前etl中的hive任务一直报错,持续一上午,也没有查出原因,错误的任务的日志也找到,原本可以找到原因,但是打开日志,心里面一凉,什么报错也没有,不知所错。最后观察报错的节点,最终集中到两台机器,那就看看是不是这两台机器的hadoop的程序引起的吗?看看他们的程序都在,但是查看nodemanager的日志一直报错,并且查看cpu,nodemanager进程占用的cpu达1000%多,马上眼前一亮,知道cpu占用太多,导致ap不能联系,导致任务失败,最后把这两台机器的nodemanager重启一下,观察了一下,任务不在报错。继续努力.............
ApplicationFilterFactory与ApplicationFilterChain-tomcat6.x源码阅读
2013-11-11
ApplicationFilterFactory和ApplicationFilterChain都是跟Filter相关的类,前者根据注册在Wrapper的Filter,经过筛选成产后者,后者是多个Filter集合的管理类。
ApplicationFilterFactory
是个单例工厂类,负责为Servlet生成FilterChain,在createFilterChain(ServletRequest, Wrapper, Servlet)方法内部,通过URL与Filter URL过滤规则配置为Servlet生成FilterChain,具体如下:
- 取dispatcher type,用于验证请求
- 验证参数正确性,如验证request
- 创建ApplicationFilterChain对象实例,为装载Filter做准备
- 取Wrapper所在Context上的所以Filter定义
- 按路径(url path)匹配规则筛选Filter,添加Filter到ApplicationChain中
- 按Servlet Name匹配规则筛选Filter,添加Filter到ApplicationChian中
/**
* Construct and return a FilterChain implementation that will wrap the
* execution of the specified servlet instance. If we should not execute a
* filter chain at all, return <code>null</code>.
*
* @param request
* The servlet request we are processing
* @param servlet
* The servlet instance to be wrapped
*/
public ApplicationFilterChain createFilterChain(ServletRequest request,
Wrapper wrapper, Servlet servlet) {
// get the dispatcher type
int dispatcher = -1;
if (request.getAttribute(DISPATCHER_TYPE_ATTR) != null) {
Integer dispatcherInt = (Integer) request
.getAttribute(DISPATCHER_TYPE_ATTR);
dispatcher = dispatcherInt.intValue();
}
String requestPath = null;
Object attribute = request.getAttribute(DISPATCHER_REQUEST_PATH_ATTR);
if (attribute != null) {
requestPath = attribute.toString();
}
HttpServletRequest hreq = null;
if (request instanceof HttpServletRequest)
hreq = (HttpServletRequest) request;
// If there is no servlet to execute, return null
if (servlet == null)
return (null);
boolean comet = false;
// Create and initialize a filter chain object
ApplicationFilterChain filterChain = null;
if (request instanceof Request) {
Request req = (Request) request;
comet = req.isComet();
if (Globals.IS_SECURITY_ENABLED) {
// Security: Do not recycle
filterChain = new ApplicationFilterChain();
if (comet) {
req.setFilterChain(filterChain);
}
} else {
filterChain = (ApplicationFilterChain) req.getFilterChain();
if (filterChain == null) {
filterChain = new ApplicationFilterChain();
req.setFilterChain(filterChain);
}
}
} else {
// Request dispatcher in use
filterChain = new ApplicationFilterChain();
}
filterChain.setServlet(servlet);
filterChain
.setSupport(((StandardWrapper) wrapper).getInstanceSupport());
// Acquire the filter mappings for this Context
StandardContext context = (StandardContext) wrapper.getParent();
FilterMap filterMaps[] = context.findFilterMaps();
// If there are no filter mappings, we are done
if ((filterMaps == null) || (filterMaps.length == 0))
return (filterChain);
// Acquire the information we will need to match filter mappings
String servletName = wrapper.getName();
// Add the relevant path-mapped filters to this filter chain
for (int i = 0; i < filterMaps.length; i++) {
if (!matchDispatcher(filterMaps[i], dispatcher)) {
continue;
}
if (!matchFiltersURL(filterMaps[i], requestPath))
continue;
ApplicationFilterConfig filterConfig = (ApplicationFilterConfig) context
.findFilterConfig(filterMaps[i].getFilterName());
if (filterConfig == null) {
; // FIXME - log configuration problem
continue;
}
boolean isCometFilter = false;
if (comet) {
try {
isCometFilter = filterConfig.getFilter() instanceof CometFilter;
} catch (Exception e) {
// Note: The try catch is there because getFilter has a lot
// of
// declared exceptions. However, the filter is allocated
// much
// earlier
}
if (isCometFilter) {
filterChain.addFilter(filterConfig);
}
} else {
filterChain.addFilter(filterConfig);
}
}
// Add filters that match on servlet name second
for (int i = 0; i < filterMaps.length; i++) {
if (!matchDispatcher(filterMaps[i], dispatcher)) {
continue;
}
if (!matchFiltersServlet(filterMaps[i], servletName))
continue;
ApplicationFilterConfig filterConfig = (ApplicationFilterConfig) context
.findFilterConfig(filterMaps[i].getFilterName());
if (filterConfig == null) {
; // FIXME - log configuration problem
continue;
}
boolean isCometFilter = false;
if (comet) {
try {
isCometFilter = filterConfig.getFilter() instanceof CometFilter;
} catch (Exception e) {
// Note: The try catch is there because getFilter has a lot
// of
// declared exceptions. However, the filter is allocated
// much
// earlier
}
if (isCometFilter) {
filterChain.addFilter(filterConfig);
}
} else {
filterChain.addFilter(filterConfig);
}
}
// Return the completed filter chain
return (filterChain);
}
以上ApplicationFilterFactory完成了生产ApplicationFilterChain的任务,为Wrapper(Servlet)从Context上面筛选Filter并添加到FilterChian中。在ApplicationFilterChain中,主要是doFilter(ServletRequest, ServletResponse)方法完成Filter过滤Serlvet且最后调用servlet的service()方法的功能。
ApplicationFilterChain 在ApplicationFilterFactory完成生产FilterChain的任务后,ApplicationFIlterChain的功能则是使用FilterChain来过滤Servlet,由于它实现了Filterchain接口,所以具有Filterchain的功能,并且最终调用servlet.service()方法,在doFilter(ServletRequest, ServletResponse)方法中调用internalDoFilter(ServletRequest, ServletResponse)来完成,首先使用Filter过滤Servlet,最后完成service方法的调用。具体如下:
- 判断是否已经过滤到FilterChain链最后一个Filter,没有则继续调用doFilter(ServletRequest, ServletResponse)
- 在最后一个Filter过滤完成之后,也即在递归方法的最内部中,调用servlet.service(request, response);执行servlet
- 在完成service方法调用后,方法递归出来,继续执行每一层Filter中的逻辑定义
/**
* 调用doFilter方法递归过滤servlet,在递归最内部调用servlet.service()
* @param request
* @param response
* @throws IOException
* @throws ServletException
*/
private void internalDoFilter(ServletRequest request,
ServletResponse response) throws IOException, ServletException {
// Call the next filter if there is one
//判断是否已经执行到FilterChain链尾部
if (pos < n) {
//取当前过滤Filter配置信息
ApplicationFilterConfig filterConfig = filters[pos++];
Filter filter = null;
try {
//取Filter
filter = filterConfig.getFilter();
//事件通知
support.fireInstanceEvent(InstanceEvent.BEFORE_FILTER_EVENT,
filter, request, response);
//安全判断
if (Globals.IS_SECURITY_ENABLED) {
final ServletRequest req = request;
final ServletResponse res = response;
Principal principal = ((HttpServletRequest) req)
.getUserPrincipal();
Object[] args = new Object[] { req, res, this };
//执行调用Filter的doFilter()方法
SecurityUtil.doAsPrivilege("doFilter", filter, classType,
args, principal);
args = null;
} else {
//执行调用Filter的doFilter()方法
filter.doFilter(request, response, this);
}
//完成Filter过滤事件通知
support.fireInstanceEvent(InstanceEvent.AFTER_FILTER_EVENT,
filter, request, response);
} catch (IOException e) {
if (filter != null)
support.fireInstanceEvent(InstanceEvent.AFTER_FILTER_EVENT,
filter, request, response, e);
throw e;
} catch (ServletException e) {
if (filter != null)
support.fireInstanceEvent(InstanceEvent.AFTER_FILTER_EVENT,
filter, request, response, e);
throw e;
} catch (RuntimeException e) {
if (filter != null)
support.fireInstanceEvent(InstanceEvent.AFTER_FILTER_EVENT,
filter, request, response, e);
throw e;
} catch (Throwable e) {
if (filter != null)
support.fireInstanceEvent(InstanceEvent.AFTER_FILTER_EVENT,
filter, request, response, e);
throw new ServletException(sm.getString("filterChain.filter"),
e);
}
return;
}
// We fell off the end of the chain -- call the servlet instance
try {
//安全校验
if (Globals.STRICT_SERVLET_COMPLIANCE) {
lastServicedRequest.set(request);
lastServicedResponse.set(response);
}
//调用servlet.service()事件通知
support.fireInstanceEvent(InstanceEvent.BEFORE_SERVICE_EVENT,
servlet, request, response);
if ((request instanceof HttpServletRequest)
&& (response instanceof HttpServletResponse)) {
//安全校验
if (Globals.IS_SECURITY_ENABLED) {
final ServletRequest req = request;
final ServletResponse res = response;
Principal principal = ((HttpServletRequest) req)
.getUserPrincipal();
Object[] args = new Object[] { req, res };
SecurityUtil.doAsPrivilege("service", servlet,
classTypeUsedInService, args, principal);
args = null;
} else {
//调用servlet.service()方法
servlet.service((HttpServletRequest) request,
(HttpServletResponse) response);
}
} else {
//调用servlet.service()方法
servlet.service(request, response);
}
//完成servlet.service()调用事件通知
support.fireInstanceEvent(InstanceEvent.AFTER_SERVICE_EVENT,
servlet, request, response);
} catch (IOException e) {
support.fireInstanceEvent(InstanceEvent.AFTER_SERVICE_EVENT,
servlet, request, response, e);
throw e;
} catch (ServletException e) {
support.fireInstanceEvent(InstanceEvent.AFTER_SERVICE_EVENT,
servlet, request, response, e);
throw e;
} catch (RuntimeException e) {
support.fireInstanceEvent(InstanceEvent.AFTER_SERVICE_EVENT,
servlet, request, response, e);
throw e;
} catch (Throwable e) {
support.fireInstanceEvent(InstanceEvent.AFTER_SERVICE_EVENT,
servlet, request, response, e);
throw new ServletException(sm.getString("filterChain.servlet"), e);
} finally {
//安全校验
if (Globals.STRICT_SERVLET_COMPLIANCE) {
lastServicedRequest.set(null);
lastServicedResponse.set(null);
}
}
}
在internalDoFilter(ServletRequest, ServletResponse)方法中,可以看到servlet是在所以FilterChain最一个Filter前置过滤完成后调用,调用完成后依次递归出来,逆序调用FilterChain上的Filter后置过滤servlet。在Filter中可以添加校验逻辑,日志记录等信息。到目前为止,tomcat已经完成了使用servlet处理请求信息的功能。
FilterChain的模式是设计模式中的责任链模式,该模式的必须要经过所有的链上过滤完后才会执行最后的操作。
还坚持
com.intellij.openapi.application.ApplicationActivationListener的实例源码
public PlaybackRunner(String script,StatusCallback callback,final boolean useDirectActionCall,boolean stopOnAppDeactivation,boolean useTypingTargets) { myScript = script; myCallback = callback; myUseDirectActionCall = useDirectActionCall; myUseTypingTargets = useTypingTargets; myStopOnAppDeactivation = stopOnAppDeactivation; myAppListener = new ApplicationActivationListener.Adapter() { @Override public void applicationDeactivated(IdeFrame ideFrame) { if (myStopOnAppDeactivation) { myCallback.message(null,"App lost focus,stopping...",StatusCallback.Type.message); stop(); } } }; }
private boolean isAppActive() { Application app = ApplicationManager.getApplication(); if (app != null && myAppListener == null) { myAppListener = new ApplicationActivationListener.Adapter() { @Override public void applicationActivated(IdeFrame ideFrame) { hideProgress(ideFrame.getProject(),myCurrentProcessId); _setokBadge(ideFrame,false); _setTextBadge(ideFrame,null); } }; app.getMessageBus().connect().subscribe(ApplicationActivationListener.TOPIC,myAppListener); } return app != null && app.isActive(); }
public void addRequest(@Nonnull final Runnable request,final int delay,boolean runWithActiveFrameOnly) { if (runWithActiveFrameOnly && !ApplicationManager.getApplication().isActive()) { final MessageBus bus = ApplicationManager.getApplication().getMessageBus(); final MessageBusConnection connection = bus.connect(this); connection.subscribe(ApplicationActivationListener.TOPIC,new ApplicationActivationListener() { @Override public void applicationActivated(IdeFrame ideFrame) { connection.disconnect(); addRequest(request,delay); } }); } else { addRequest(request,delay); } }
public PlaybackRunner(String script,StatusCallback.Type.message); stop(); } } }; }
private void updateConnection() { final ApplicationEx app = ApplicationManagerEx.getApplicationEx(); boolean value = PropertiesComponent.getInstance().getBoolean(KEY); if(value) { myConnection = app.getMessageBus().connect(); myConnection.subscribe(ApplicationActivationListener.TOPIC,myListener); } else { if(myConnection != null) { myConnection.disconnect(); } } }
public void afterValueChanged(RegistryValue value) { if (value.asBoolean()) { ourConnection = app.getMessageBus().connect(); ourConnection.subscribe(ApplicationActivationListener.TOPIC,LISTENER); } else { ourConnection.disconnect(); } }
public void addRequest(@NotNull final Runnable request,new ApplicationActivationListener.Adapter() { @Override public void applicationActivated(IdeFrame ideFrame) { connection.disconnect(); addRequest(request,delay); } }); } else { addRequest(request,delay); } }
public void show(final Component component,int x,int y) { if (!component.isShowing()) { //noinspection HardCodedStringLiteral throw new IllegalArgumentException("component must be shown on the screen"); } removeAll(); // Fill menu. Only after filling menu has non zero size. int x2 = Math.max(0,Math.min(x,component.getWidth() - 1)); // fit x into [0,width-1] int y2 = Math.max(0,Math.min(y,component.getHeight() - 1)); // fit y into [0,height-1] myContext = myDataContextProvider != null ? myDataContextProvider.get() : DataManager.getInstance().getDataContext(component,x2,y2); Utils.fillMenu(myGroup,this,true,myPresentationFactory,myContext,myPlace,false,false); if (getComponentCount() == 0) { return; } if (myApp != null) { if (myApp.isActive()) { Component frame = UIUtil.findUltimateParent(component); if (frame instanceof IdeFrame) { myFrame = (IdeFrame)frame; } myConnection = myApp.getMessageBus().connect(); myConnection.subscribe(ApplicationActivationListener.TOPIC,ActionPopupMenuImpl.this); } } super.show(component,x,y); }
private MountainLionNotifications() { final MessageBusConnection connection = ApplicationManager.getApplication().getMessageBus().connect(); connection.subscribe(ApplicationActivationListener.TOPIC,new ApplicationActivationListener.Adapter() { @Override public void applicationActivated(IdeFrame ideFrame) { cleanupDeliverednotifications(); } }); connection.subscribe(AppLifecycleListener.TOPIC,new AppLifecycleListener.Adapter() { @Override public void appClosing() { cleanupDeliverednotifications(); } }); }
private static boolean setActive(Application application,Window window) { IdeFrame ideFrame = getIdeFrameFromWindow(window); state = State.ACTIVE; LOG.debug("The app is in the active state"); if (ideFrame != null) { application.getMessageBus().syncpublisher(ApplicationActivationListener.TOPIC).applicationActivated(ideFrame); return true; } return false; }
/** * Adds IntelliJ listeners including already opened windows and * registers shutdown and debugger listeners. */ public void attachListeners() { WatchDogEventType.START_IDE.process(this); connection.subscribe(ApplicationActivationListener.TOPIC,new IntelliJActivationListener()); activityListener = new GeneralActivityListener(project.getName()); EditorFactory.getInstance().addEditorFactoryListener(editorWindowListener,parent); attachDebuggerListeners(); }
public void afterValueChanged(RegistryValue value) { if (value.asBoolean()) { ourConnection = app.getMessageBus().connect(); ourConnection.subscribe(ApplicationActivationListener.TOPIC,LISTENER); } else { ourConnection.disconnect(); } }
@Override public void show(final Component component,LaterInvocator.isInModalContext()); if (getComponentCount() == 0) { return; } if (myApp != null) { if (myApp.isActive()) { Component frame = UIUtil.findUltimateParent(component); if (frame instanceof IdeFrame) { myFrame = (IdeFrame)frame; } myConnection = myApp.getMessageBus().connect(); myConnection.subscribe(ApplicationActivationListener.TOPIC,ActionPopupMenuImpl.this); } } super.show(component,y); }
private MountainLionNotifications() { final MessageBusConnection connection = ApplicationManager.getApplication().getMessageBus().connect(); connection.subscribe(ApplicationActivationListener.TOPIC,new AppLifecycleListener() { @Override public void appClosing() { cleanupDeliverednotifications(); } }); }
private static boolean setActive(Application application,Window window) { IdeFrame ideFrame = getIdeFrameFromWindow(window); state = State.ACTIVE; LOG.debug("The app is in the active state"); if (ideFrame != null) { application.getMessageBus().syncpublisher(ApplicationActivationListener.TOPIC).applicationActivated(ideFrame); return true; } return false; }
@SuppressWarnings("UnusedParameters") // the dependencies are needed to ensure correct loading order public FocusManagerImpl(ServiceManagerImpl serviceManager,WindowManager wm,UiActivityMonitor monitor) { myApp = ApplicationManager.getApplication(); myQueue = IdeEventQueue.getInstance(); myActivityMonitor = monitor; myFocusedComponentAlarm = new EdtAlarm(); myForcedFocusRequestsAlarm = new EdtAlarm(); myIdleAlarm = new EdtAlarm(); final AppListener myAppListener = new AppListener(); myApp.getMessageBus().connect().subscribe(ApplicationActivationListener.TOPIC,myAppListener); IdeEventQueue.getInstance().adddispatcher(new IdeEventQueue.Eventdispatcher() { @Override public boolean dispatch(AWTEvent e) { if (e instanceof FocusEvent) { final FocusEvent fe = (FocusEvent)e; final Component c = fe.getComponent(); if (c instanceof Window || c == null) return false; Component parent = UIUtil.findUltimateParent(c); if (parent instanceof IdeFrame) { myLastFocused.put((IdeFrame)parent,c); } } else if (e instanceof WindowEvent) { Window wnd = ((WindowEvent)e).getwindow(); if (e.getID() == WindowEvent.WINDOW_CLOSED) { if (wnd instanceof IdeFrame) { myLastFocused.remove(wnd); myLastFocusedAtDeactivation.remove(wnd); } } } return false; } },this); KeyboardFocusManager.getCurrentKeyboardFocusManager().addPropertychangelistener("focusedWindow",new Propertychangelistener() { @Override public void propertyChange(PropertyChangeEvent evt) { if (evt.getNewValue() instanceof IdeFrame) { myLastFocusedFrame = (IdeFrame)evt.getNewValue(); } } }); }
public ActionCallback run() { myStopRequested = false; myRegistryValues.clear(); final UiActivityMonitor activityMonitor = UiActivityMonitor.getInstance(); activityMonitor.clear(); activityMonitor.setActive(true); myCurrentStageDepth.clear(); myPassedStages.clear(); myContextTimestamp++; ApplicationManager.getApplication().getMessageBus().connect(ApplicationManager.getApplication()).subscribe(ApplicationActivationListener.TOPIC,myAppListener); try { myActionCallback = new ActionCallback(); myActionCallback.doWhenProcessed(new Runnable() { @Override public void run() { stop(); SwingUtilities.invokelater(new Runnable() { @Override public void run() { activityMonitor.setActive(false); restoreRegistryValues(); } }); } }); myRobot = new Robot(); parse(); new Thread("playback runner") { @Override public void run() { if (myUseDirectActionCall) { executeFrom(0,getScriptDir()); } else { IdeEventQueue.getInstance().doWhenReady(new Runnable() { public void run() { executeFrom(0,getScriptDir()); } }); } } }.start(); } catch (AWTException e) { LOG.error(e); } return myActionCallback; }
protected JComponent createCenterPanel() { JPanel panel = new MyPanel(); myUiUpdater = new MergingUpdateQueue("FileChooserUpdater",200,panel); disposer.register(mydisposable,myUiUpdater); new UiNotifyConnector(panel,myUiUpdater); panel.setBorder(JBUI.Borders.empty()); createTree(); final DefaultActionGroup group = createActionGroup(); ActionToolbar toolBar = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNowN,group,true); toolBar.setTargetComponent(panel); final JPanel toolbarPanel = new JPanel(new BorderLayout()); toolbarPanel.add(toolBar.getComponent(),BorderLayout.CENTER); myTextFieldAction = new TextFieldAction() { public void linkSelected(final LinkLabel aSource,final Object aLinkData) { toggleshowtextField(); } }; toolbarPanel.add(myTextFieldAction,BorderLayout.EAST); JPanel extraToolbarPanel = createExtraToolbarPanel(); if(extraToolbarPanel != null){ toolbarPanel.add(extraToolbarPanel,BorderLayout.soUTH); } myPathTextFieldWrapper = new JPanel(new BorderLayout()); myPathTextFieldWrapper.setBorder(JBUI.Borders.emptyBottom(2)); myPathTextField = new FileTextFieldImpl.Vfs( FileChooserFactoryImpl.getMacroMap(),getdisposable(),new LocalFsFinder.FileChooserFilter(myChooserDescriptor,myFileSystemTree)) { protected void onTextChanged(final String newValue) { myUiUpdater.cancelAllUpdates(); updateTreeFromPath(newValue); } }; disposer.register(mydisposable,myPathTextField); myPathTextFieldWrapper.add(myPathTextField.getField(),BorderLayout.CENTER); if (getRecentFiles().length > 0) { myPathTextFieldWrapper.add(createHistoryButton(),BorderLayout.EAST); } mynorthPanel = new JPanel(new BorderLayout()); mynorthPanel.add(toolbarPanel,BorderLayout.norTH); updateTextFieldShowing(); panel.add(mynorthPanel,BorderLayout.norTH); registerMouseListener(group); JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myFileSystemTree.getTree()); //scrollPane.setBorder(BorderFactory.createLineBorder(new Color(148,154,156))); panel.add(scrollPane,BorderLayout.CENTER); panel.setPreferredSize(JBUI.size(400)); panel.add(new JLabel(DRAG_N_DROP_HINT,SwingConstants.CENTER),BorderLayout.soUTH); ApplicationManager.getApplication().getMessageBus().connect(getdisposable()) .subscribe(ApplicationActivationListener.TOPIC,new ApplicationActivationListener.Adapter() { @Override public void applicationActivated(IdeFrame ideFrame) { DumbService.allowStartingDumbModeInside(DumbModePermission.MAY_START_MODAL,new Runnable() { @Override public void run() { ((SaveAndSyncHandlerImpl)SaveAndSyncHandler.getInstance()).maybeRefresh(ModalityState.current()); } }); } }); return panel; }
@SuppressWarnings("UnusedParameters") // the dependencies are needed to ensure correct loading order public FocusManagerImpl(ServiceManagerImpl serviceManager,UiActivityMonitor monitor) { myApp = ApplicationManager.getApplication(); myQueue = IdeEventQueue.getInstance(); myActivityMonitor = monitor; myFocusedComponentAlaram = new EdtAlarm(); myForcedFocusRequestsAlarm = new EdtAlarm(); myIdleAlarm = new EdtAlarm(); final AppListener myAppListener = new AppListener(); myApp.getMessageBus().connect().subscribe(ApplicationActivationListener.TOPIC,myAppListener); IdeEventQueue.getInstance().adddispatcher(new IdeEventQueue.Eventdispatcher() { public boolean dispatch(AWTEvent e) { if (e instanceof FocusEvent) { final FocusEvent fe = (FocusEvent)e; final Component c = fe.getComponent(); if (c instanceof Window || c == null) return false; Component parent = SwingUtilities.getwindowAncestor(c); if (parent instanceof IdeFrame) { myLastFocused.put((IdeFrame)parent,new WeakReference<Component>(c)); } } else if (e instanceof WindowEvent) { Window wnd = ((WindowEvent)e).getwindow(); if (e.getID() == WindowEvent.WINDOW_CLOSED) { if (wnd instanceof IdeFrame) { myLastFocused.remove((IdeFrame)wnd); myLastFocusedAtDeactivation.remove((IdeFrame)wnd); } } } return false; } },new Propertychangelistener() { @Override public void propertyChange(PropertyChangeEvent evt) { if (evt.getNewValue() instanceof IdeFrame) { myLastFocusedFrame = (IdeFrame)evt.getNewValue(); } } }); }
public ActionCallback run() { myStopRequested = false; myRegistryValues.clear(); final UiActivityMonitor activityMonitor = UiActivityMonitor.getInstance(); activityMonitor.clear(); activityMonitor.setActive(true); myCurrentStageDepth.clear(); myPassedStages.clear(); myContextTimestamp++; ApplicationManager.getApplication().getMessageBus().connect(myOnStop).subscribe(ApplicationActivationListener.TOPIC,myAppListener); try { myActionCallback = new ActionCallback(); myActionCallback.doWhenProcessed(new Runnable() { @Override public void run() { stop(); SwingUtilities.invokelater(new Runnable() { @Override public void run() { activityMonitor.setActive(false); restoreRegistryValues(); } }); } }); myRobot = new Robot(); parse(); new Thread() { @Override public void run() { if (myUseDirectActionCall) { executeFrom(0,getScriptDir()); } }); } } }.start(); } catch (AWTException e) { LOG.error(e); } return myActionCallback; }
@SuppressWarnings("UnusedParameters") // the dependencies are needed to ensure correct loading order public FocusManagerImpl(ServiceManagerImpl serviceManager,UiActivityMonitor monitor) { myApp = ApplicationManager.getApplication(); myQueue = IdeEventQueue.getInstance(); myActivityMonitor = monitor; myFocusedComponentAlarm = new EdtAlarm(); myForcedFocusRequestsAlarm = new EdtAlarm(); final AppListener myAppListener = new AppListener(); myApp.getMessageBus().connect().subscribe(ApplicationActivationListener.TOPIC,myAppListener); IdeEventQueue.getInstance().adddispatcher(e -> { if (e instanceof FocusEvent) { final FocusEvent fe = (FocusEvent)e; final Component c = fe.getComponent(); if (c instanceof Window || c == null) return false; Component parent = UIUtil.findUltimateParent(c); if (parent instanceof IdeFrame) { myLastFocused.put((IdeFrame)parent,c); } } else if (e instanceof WindowEvent) { Window wnd = ((WindowEvent)e).getwindow(); if (e.getID() == WindowEvent.WINDOW_CLOSED) { if (wnd instanceof IdeFrame) { myLastFocused.remove(wnd); myLastFocusedAtDeactivation.remove(wnd); } } } return false; },new Propertychangelistener() { @Override public void propertyChange(PropertyChangeEvent evt) { if (evt.getNewValue() instanceof IdeFrame) { myLastFocusedFrame = (IdeFrame)evt.getNewValue(); } } }); }
public ActionCallback run() { myStopRequested = false; myRegistryValues.clear(); final UiActivityMonitor activityMonitor = UiActivityMonitor.getInstance(); activityMonitor.clear(); activityMonitor.setActive(true); myCurrentStageDepth.clear(); myPassedStages.clear(); myContextTimestamp++; ApplicationManager.getApplication().getMessageBus().connect(myOnStop).subscribe(ApplicationActivationListener.TOPIC,getScriptDir()); } }); } } }.start(); } catch (AWTException e) { LOG.error(e); } return myActionCallback; }
public FocusDrawer() { super("focus debugger"); Application app = ApplicationManager.getApplication(); app.getMessageBus().connect().subscribe(ApplicationActivationListener.TOPIC,this); }
protected JComponent createCenterPanel() { JPanel panel = new MyPanel(); myUiUpdater = new MergingUpdateQueue("FileChooserUpdater",BorderLayout.EAST); JPanel extraToolbarPanel = createExtraToolbarPanel(); if (extraToolbarPanel != null) { toolbarPanel.add(extraToolbarPanel,BorderLayout.soUTH); } myPathTextFieldWrapper = new JPanel(new BorderLayout()); myPathTextFieldWrapper.setBorder(JBUI.Borders.emptyBottom(2)); myPathTextField = new FileTextFieldImpl.Vfs(FileChooserFactoryImpl.getMacroMap(),BorderLayout.CENTER); panel.setPreferredSize(JBUI.size(400)); JLabel hintLabel = new JLabel(DRAG_N_DROP_HINT,SwingConstants.CENTER); hintLabel.setForeground(JBColor.gray); hintLabel.setFont(JBUI.Fonts.smallFont()); panel.add(hintLabel,BorderLayout.soUTH); ApplicationManager.getApplication().getMessageBus().connect(getdisposable()) .subscribe(ApplicationActivationListener.TOPIC,new ApplicationActivationListener() { @Override public void applicationActivated(IdeFrame ideFrame) { ((SaveAndSyncHandlerImpl)SaveAndSyncHandler.getInstance()).maybeRefresh(ModalityState.current()); } }); return panel; }
今天关于rails 3.1.0 ActionView::Template::Error和application.css 未预编译的分享就到这里,希望大家有所收获,若想了解更多关于android – ApplicationStatus类E / SysUtils:ApplicationStat中的ApplicationContext为null、Application application_1512618719369_147804 failed 2 times due to ApplicationMaster for attempt app、ApplicationFilterFactory与ApplicationFilterChain-tomcat6.x源码阅读、com.intellij.openapi.application.ApplicationActivationListener的实例源码等相关知识,可以在本站进行查询。
本文标签: