2 * Copyright 2000-2009 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package com
.intellij
.uiDesigner
.snapShooter
;
19 import com
.intellij
.execution
.configurations
.RunConfigurationBase
;
20 import com
.intellij
.openapi
.util
.Key
;
25 public class SnapShooterConfigurationSettings
{
26 public static final Key
<SnapShooterConfigurationSettings
> SNAP_SHOOTER_KEY
= Key
.create("snap.shooter.settings");
27 private int myLastPort
;
28 private Runnable myNotifyRunnable
;
30 public int getLastPort() {
34 public Runnable
getNotifyRunnable() {
35 return myNotifyRunnable
;
38 public void setLastPort(final int lastPort
) {
39 myLastPort
= lastPort
;
42 public void setNotifyRunnable(final Runnable notifyRunnable
) {
43 myNotifyRunnable
= notifyRunnable
;
46 public static SnapShooterConfigurationSettings
get(final RunConfigurationBase config
) {
47 SnapShooterConfigurationSettings settings
= config
.getUserData(SNAP_SHOOTER_KEY
);
48 if (settings
== null) {
49 settings
= new SnapShooterConfigurationSettings();
50 config
.putUserData(SNAP_SHOOTER_KEY
, settings
);